Author |
Message
|
klabran |
Posted: Wed Mar 03, 2004 12:45 pm Post subject: Add attributes to an xml tag? |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
I have an output xml tag of:
<PersonHeight feet="5" inches="60"/>
My input message has two tags for this (height and inches).
I know how to get the values from the input tags but how do I put in the feet and inches attributes for the output tag?
Thanks,
Kevin |
|
Back to top |
|
 |
EddieA |
Posted: Wed Mar 03, 2004 12:51 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Search for 'Attribute' either on this site, or in the ESQL manual.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
klabran |
Posted: Wed Mar 03, 2004 1:20 pm Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
Thanks for the hint Eddie.
I seem to be missing something though...
SET OutputRoot.XML.Person.PersonWeightMeasure.(XML.Attribute)feet = InputBody.Citations.Citation[I].Person.Person_ROW.HeightFeet;
SET OutputRoot.XML.Person.PersonWeightMeasure.(XML.Attribute)inches =InputBody.Citations.Citation[I].Person.Person_ROW.HeightInches;
This creates an error at runtime. Error message is not helpful from what I can see other than 'no valid body of the document could be found.'
I even took out the InputBody code and hard coded some values but I still received the same error.
?
Kevin |
|
Back to top |
|
 |
EddieA |
Posted: Wed Mar 03, 2004 1:56 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
"No valid body" implies that the OutputRoot.XML wasn't built, or was built with more than one top level tag.
I would suggest (debug) tracing the node that builds the output tree and make sure that (a) your SETs actually do set some data so that you really have an outout tree and (b) that everything that you do build starts with EXACTLY the same top level tag.
Also, feet and inches seem a strange way of describing weight.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
klabran |
Posted: Wed Mar 03, 2004 2:05 pm Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
We like to do things in Arizona a little different.
HeHe!
Well, I can't see the output in debug mode????
All I have is the input data....
I put a break on the failure for the compute node??? |
|
Back to top |
|
 |
klabran |
Posted: Wed Mar 03, 2004 4:42 pm Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
Figured it Out.... Had to cast the inputbody values to strings...
SET OutputRoot.XML.CitationEvent.Citation.Person.PersonHeightMeasure.(XML.Attribute)feet = CAST(InputBody.Citations.Citation[I].Person.Person_ROW.HeightFeet AS CHAR);
SET OutputRoot.XML.CitationEvent.Citation.Person.PersonHeightMeasure.(XML.Attribute)inches = CAST(InputBody.Citations.Citation[I].Person.Person_ROW.HeightInches AS CHAR);
It's a real trial by fire for me on eSQL.
Thanks for all the help.
Kevin |
|
Back to top |
|
 |
|