Jump to content
Changes to the Jaspersoft community edition download ×

problem : xpath with xmldatasource


MacFly

Recommended Posts

Hi,

here is the problem:

I've got a xmldatasource with file structure like this:

 

Code:
<root>
<format>
</format>
<outputParameters>
</outputParameters>
<row>
<col0>toto0</col0>
<col1>toto1<col1>
<col2>toto2<col2>
<row>
<row>
<col0>titi0</col0>
<col1>titi1<col1>
<col2>titi2<col2>
<row>
<row>
<col0>tutu0</col0>
<col1>tutu1<col1>
<col2>tutu2<col2>
<row>
</root>

 

What is the correct xpath syntax to get col0,col1,col2 data?

 

I tried this without success:

 

Code:
[code]<queryString language="xPath"><![CDATA[/root/*]]></queryString>

<field name="col0" class="java.lang.String">
<fieldDescription><![CDATA[col0]]></fieldDescription>
</field>

 

ok but two null values are inserted corresponding to <format> and <outputparameters>

 

Code:
[code]<queryString language="xPath"><![CDATA[/root]]></queryString>

<field name="col0" class="java.lang.String">
<fieldDescription><![CDATA[row/col0]]></fieldDescription>
</field>

error because only once row is returned

 

Thanks for your help.

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...