Jump to content
We've recently updated our Privacy Statement, available here ×

xpath to XML containing namespace


viggonavarsete

Recommended Posts

Hi,

I have the following XMLdatasource:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<QueryResults
    xmlns:ns2="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader"
    xmlns:ns3="urn:epcglobal:epcis-query:xsd:1" xmlns:ns4="urn:epcglobal:epcis-masterdata:xsd:1"
    xmlns:ns5="urn:epcglobal:epcis:xsd:1">
    <results>
        <queryName>/query/SimpleEventQuery</queryName>
        <resultsBody>
            <EventList>
                <AggregationEvent>
                    <eventTime>2010-07-02T15:24:00.000+02:00</eventTime>
                    <recordTime>2010-07-06T14:12:47.311+02:00</recordTime>
                    <eventTimeZoneOffset>+02:00</eventTimeZoneOffset>
                    <parentID>DeliveryA</parentID>
                    <childEPCs>
                        <epc>Lot2</epc>
                    </childEPCs>
                    <action>DELETE</action>
                    <bizStep>urn:epcglobal:cbv:bizstep:unpacking</bizStep>
                    <ns6:transformationType
                        xmlns:ns6="http://www.globaltraceability.net/schema/epcis">LEAVECLUSTER</ns6:transformationType>
                </AggregationEvent>
                <ObjectEvent>
                    <eventTime>2010-07-02T13:24:00.000+02:00</eventTime>
                    <recordTime>2010-07-06T14:13:18.027+02:00</recordTime>
                    <eventTimeZoneOffset>+02:00</eventTimeZoneOffset>
                    <epcList>
                        <epc>Lot2</epc>
                    </epcList>
                    <action>ADD</action>
                </ObjectEvent>
                <ObjectEvent>
                    <eventTime>2010-07-02T13:24:00.000+02:00</eventTime>
                    <recordTime>2010-07-06T14:13:18.028+02:00</recordTime>
                    <eventTimeZoneOffset>+02:00</eventTimeZoneOffset>
                    <epcList>
                        <epc>Lot2</epc>
                    </epcList>
                    <action>OBSERVE</action>
                    <ns6:weight xmlns:ns6="http://www.tracefood.org/schema/epcis">1000</ns6:weight>
                </ObjectEvent>
                <ObjectEvent>
                    <eventTime>2010-07-02T13:24:00.000+02:00</eventTime>
                    <recordTime>2010-07-06T14:13:18.029+02:00</recordTime>
                    <eventTimeZoneOffset>+02:00</eventTimeZoneOffset>
                    <epcList>
                        <epc>Lot2</epc>
                    </epcList>
                    <action>OBSERVE</action>
                    <ns6:moisture xmlns:ns6="http://www.tracefood.org/schema/epcis">20</ns6:moisture>
                </ObjectEvent>
                <ObjectEvent>
                    <eventTime>2010-07-02T13:24:00.000+02:00</eventTime>
                    <recordTime>2010-07-06T14:13:18.030+02:00</recordTime>
                    <eventTimeZoneOffset>+02:00</eventTimeZoneOffset>
                    <epcList>
                        <epc>Lot2</epc>
                    </epcList>
                    <action>OBSERVE</action>
                    <ns6:noofbags xmlns:ns6="http://www.tracefood.org/schema/epcis">200</ns6:noofbags>
                </ObjectEvent>
                <ObjectEvent>
                    <eventTime>2010-07-02T13:24:00.000+02:00</eventTime>
                    <recordTime>2010-07-06T14:13:18.031+02:00</recordTime>
                    <eventTimeZoneOffset>+02:00</eventTimeZoneOffset>
                    <epcList>
                        <epc>Lot2</epc>
                    </epcList>
                    <action>OBSERVE</action>
                    <ns6:bagmarks xmlns:ns6="http://www.tracefood.org/schema/epcis">Co-op 2</ns6:bagmarks>
                </ObjectEvent>
                <ObjectEvent>
                    <eventTime>2010-07-02T13:24:00.000+02:00</eventTime>
                    <recordTime>2010-07-06T14:13:18.032+02:00</recordTime>
                    <eventTimeZoneOffset>+02:00</eventTimeZoneOffset>
                    <epcList>
                        <epc>Lot2</epc>
                    </epcList>
                    <action>OBSERVE</action>
                    <ns6:coffeetype xmlns:ns6="http://www.tracefood.org/schema/epcis">PII</ns6:coffeetype>
                </ObjectEvent>
                <ObjectEvent>
                    <eventTime>2010-07-02T13:24:00.000+02:00</eventTime>
                    <recordTime>2010-07-06T14:13:18.063+02:00</recordTime>
                    <eventTimeZoneOffset>+02:00</eventTimeZoneOffset>
                    <epcList>
                        <epc>Lot2</epc>
                    </epcList>
                    <action>OBSERVE</action>
                    <ns6:coopname xmlns:ns6="http://www.tracefood.org/schema/epcis">Co-op 2</ns6:coopname>
                </ObjectEvent>
                <ObjectEvent>
                    <eventTime>2010-07-02T13:24:00.000+02:00</eventTime>
                    <recordTime>2010-07-06T14:13:18.064+02:00</recordTime>
                    <eventTimeZoneOffset>+02:00</eventTimeZoneOffset>
                    <epcList>
                        <epc>Lot2</epc>
                    </epcList>
                    <action>OBSERVE</action>
                    <ns6:season xmlns:ns6="http://www.tracefood.org/schema/epcis">2010</ns6:season>
                </ObjectEvent>
                <ObjectEvent>
                    <eventTime>2010-07-02T13:24:00.000+02:00</eventTime>
                    <recordTime>2010-07-06T14:13:18.065+02:00</recordTime>
                    <eventTimeZoneOffset>+02:00</eventTimeZoneOffset>
                    <epcList>
                        <epc>Lot2</epc>
                    </epcList>
                    <action>OBSERVE</action>
                    <ns6:receiptno xmlns:ns6="http://www.tracefood.org/schema/epcis">Rec 2</ns6:receiptno>
                </ObjectEvent>
                <ObjectEvent>
                    <eventTime>2010-07-02T13:24:00.000+02:00</eventTime>
                    <recordTime>2010-07-06T14:13:18.066+02:00</recordTime>
                    <eventTimeZoneOffset>+02:00</eventTimeZoneOffset>
                    <epcList>
                        <epc>Lot2</epc>
                    </epcList>
                    <action>OBSERVE</action>
                    <ns6:storename xmlns:ns6="http://www.tracefood.org/schema/epcis">Store House 2
                    </ns6:storename>
                </ObjectEvent>
                <ObjectEvent>
                    <eventTime>2010-07-02T13:24:00.000+02:00</eventTime>
                    <recordTime>2010-07-06T14:13:18.067+02:00</recordTime>
                    <eventTimeZoneOffset>+02:00</eventTimeZoneOffset>
                    <epcList>
                        <epc>Lot2</epc>
                    </epcList>
                    <action>OBSERVE</action>
                    <ns6:remarks xmlns:ns6="http://www.tracefood.org/schema/epcis">okay</ns6:remarks>
                </ObjectEvent>
            </EventList>
        </resultsBody>
    </results>
</QueryResults>

 

and I want to retrieve elements having inline namespace ns6, like the

/QueryResults/results/resultsBody/EventList/ObjectEvent/ns6:remarks

So, I drag the element into the Field table in the Report Query so that a Field is created, all fine so far. Then I map the field created into a a field in the report, and then I try to preview the report, which gives me the following failure:

Error filling print...XPath seletion failed. Expression: ObjectEvent/ns6:remarks

and a long stacktrace. I assume it has something todo with the inline namespace? or? How could I make this work?

 

Best regards,

Viggo Navarsete

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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...