Author |
Message
|
RocknRambo |
Posted: Mon Mar 13, 2006 5:06 pm Post subject: Second Header of an xml |
|
|
Partisan
Joined: 24 Sep 2003 Posts: 355
|
can anyone guide me how do I acces second header of an xml..
Quote: |
<?xml version="1.0" encoding="UTF-8"?>
<?CWRSD status="-1" description=" Msg. Set Number: 15 Msg. Number: 11, Msg. Type 1, Message: Invalid value -- press the prompt button or hyperlink for a list of valid values (15,11) Msg. Set Number: 91 Msg. Number: 34, Msg. Type 1, Message: Error changing value. {RF_SERVICE_ORDER.SITE_ID} (91,34) Msg. Set Number: 0 Msg. Number: 0, Msg. Type 1, Message: Failed to execute PSBusComp request "?> |
was trying to use
Code: |
FIELDNAME(InputRoot.XML.*[2]); |
coming as blank
Thanks
-RR |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Mar 13, 2006 5:24 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
An XML is not like an MRM.
It has to be well formed:
InputRoot.XML.<xmlroot>
There can only be one element under InputRoot.XML and this is your root xmltag. Let's look at a book:
InputRoot.XML.mybook.[] here [] would represent the collection of chapters.
You cannot have 2 books in this example. If you want 2 books you need a parent tag to "carry them in" that will be your xml root tag.
Enjoy
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Mar 13, 2006 5:45 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
RocknRambo |
Posted: Mon Mar 13, 2006 5:46 pm Post subject: |
|
|
Partisan
Joined: 24 Sep 2003 Posts: 355
|
Correct, There shud be one & only one Root Tag.. but the same there could be multiple headers..
for Ex: in the given snippet
Quote: |
<?xml version="1.0" encoding="UTF-8"?> xml Header
<?CWRSD status="-1" description=" Msg. custom Header |
I think is a valid one
-RR |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Mar 13, 2006 5:52 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
RocknRambo -
"Header" is the wrong word.
XML is very specific about what things are called, and I believe the one you're using is a generic processing instruction and not something else.
Try and see what
Code: |
InputRoot.XML.(XML.ProcessingInstruction)CWRSD.(XML.Attribute)status |
returns. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
RocknRambo |
Posted: Mon Mar 13, 2006 5:53 pm Post subject: |
|
|
Partisan
Joined: 24 Sep 2003 Posts: 355
|
Jeff,
the link specifies accessing XmlDecl <?xml version="1.0">.. but didnt find custom header (second header)..
I might be missing something.. am I ?
thanks
-RR |
|
Back to top |
|
 |
JT |
Posted: Mon Mar 13, 2006 5:56 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
|
Back to top |
|
 |
RocknRambo |
Posted: Mon Mar 13, 2006 6:19 pm Post subject: |
|
|
Partisan
Joined: 24 Sep 2003 Posts: 355
|
Thank you for the terminology,
Code: |
InputRoot.XML.(XML.ProcessingInstruction)CWRSD.(XML.Attribute)status |
is NOT return the Status in tht...
but
Code: |
InputRoot.XML.(XML.ProcessingInstruction)CWRSD |
does return the whole,
I'm looking for the attribute "Message:", which contains the error.. but else too. can Live
Thanks
-RR |
|
Back to top |
|
 |
SixBlade |
Posted: Tue Mar 14, 2006 2:41 am Post subject: |
|
|
Apprentice
Joined: 03 Dec 2003 Posts: 26 Location: UK
|
Hi,
as far as I understand, the parser won't treat the value after <?CWRSD as xml attributes, it's just a value:
From http://aspalliance.com/515#Page2
"Firstly, what is an XML processing instruction? A processing instruction (PI) is a tag that encodes specific application information which begins with <? and ends with ?>. An XML document can contain multiple processing instructions for different applications. There are two parts to a processing instruction, a target and a value. The target acts like a name and the value is the string after the target. The value can consist of multiple tokens.
<?target value?>" |
|
Back to top |
|
 |
RocknRambo |
Posted: Tue Mar 14, 2006 6:33 am Post subject: |
|
|
Partisan
Joined: 24 Sep 2003 Posts: 355
|
Thanks Much!.. very Educative.
-RR |
|
Back to top |
|
 |
|