| |

VerySource

 Forgot password?
 Register
Search
View: 777|Reply: 2

Has anyone encountered some problems with birt.

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-7 19:20:01
| Show all posts |Read mode
I have some problems using xml as a datasource.

The xml code is as follows:
<config>
        <parameter name =\"protocol\" value =\"http\" />
        <parameter name =\"summary\" value =\"yes\" />
        <parameter name =\"saveresponse\" value =\"yes\" />
        <parameter name =\"timeout\" value =\"300\" />
        <parameter name =\"haltonerror\" value =\"yes\" />
        <parameter name =\"port\" value =\"80\" />
        <parameter name =\"resultfile\" value =\"results.xml\" />
        <parameter name =\"showhtmlparseroutput\" value =\"no\" />
        <parameter name =\"host\" value =\"www.qa.ehealthinsurance.com/\" />
        <parameter name =\"haltonfailure\" value =\"yes\" />
        <parameter name =\"basepath\" value =\".\" />
        <parameter name =\"saveprefix\" value =\"response\" />
</ config>

I use xpath to specify / config / parameter / @ name only to get the protocol, instead of looping to get the name attribute of all parameters
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-26 16:30:01
| Show all posts
up
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-27 13:15:01
| Show all posts
List list = document.selectNodes("/config/parameter/@name");
Iterator iter = list.iterator();

Then, use while(iter.hasNext())() to get out each element

Try it yourself
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list