on 02-24-2009 12:55 AM
I need to repeat the top level element for each child element.
My structure is
<Sensor xmlns=namespace>
<Observation>
<XML> some data </XML>
</Observation>
</Sensor
Observation is 1:n, I need sensor to repeat every observation.
Currently i have for-each loop that places the document in the following structure
<Sensor xmlns=namespace>
<Observation>
<XML> some data </XML>
</Observation>
<Observation>
<XML> some data </XML>
</Observation>
<Observation>
<XML> some data </XML>
</Observation>
<Observation>
<XML> some data </XML>
</Observation>
</Sensor>
How do I get Sensor to repeat without error? I am using XSLT.
I get this error when i tried puting sensor tag part of the loop
Only one top level element is allowed in an XML document. Error processing resource 'file:///...
<pmlcore:Sensor xmlns:pmlcore="urn:autoid:specification:interchange:PMLCore:xml:schema:1" xmlns:pmluid="urn:autoid:specif...
Hi,
if you want to repeat the sensor element, you need to create a new root element.
Regards,
Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Why not create a parameter from the root element which you want to present in each line. and include this entry in the target elements.
If you need a code snipplet let me know
Greets
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi chirag,
If you are using XSLT Mapping use loop statement,how to use loop statement open w3schools.com ,
you wil find XSLT Docs and how to use.
Regards,
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi chirag,
i think u cant repeat ur sensor tag in same XML.
Xi follow soap xml message format . It has following tags
1) Soap envelop
2) Soap header
3) Soap body
The required SOAP Envelope element is the root element of a SOAP message. This element defines the XML document as a SOAP message. And root always having occurrence 1.
The optional SOAP Header element contains application-specific information (like authentication, payment, etc) about the SOAP message. If the Header element is present, it must be the first child element of the Envelope element
The required SOAP Body element contains the actual SOAP message intended for the ultimate endpoint of the message. Its may occur may times.
And if u r trying to make many soap envelop(sensor) than it is not possible . for this u need to break this message in individual xml messages.
Regards, navneet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.