Author |
Message
|
venkat kurra |
Posted: Fri Jun 09, 2006 7:28 pm Post subject: XML Format |
|
|
 Master
Joined: 18 Oct 2001 Posts: 245 Location: Bloomington , IL
|
Hi,
I am trying to get SSNTaxID (= SSN) from the follwoing xml message,
<?xml version="1.0" encoding="UTF-8"?><bons0:CustomerResponse xmlns:bons0="http://CRMIntegrationLibrary/Customer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://CRMIntegrationLibrary/Customer CustomerResponse.xsd "><SSN>SSN</SSN><dateOfBirth>dateOfBirth</dateOfBirth><response>response1</response></bons0:CustomerResponse>
the following statement is not working for me,
SET OutputRoot.XML.CustomerResponse.SSN = InputRoot.XML.CustomerResponse.SSNTaxID;
also tried
SET OutputRoot.XML.SSN = InputRoot.XML.CustomerResponse.SSNTaxID;
Do i need to add any additional tag? _________________ Thanks,
Venkat Kurra
IBM Certified Specialist-MQSeries
IBM Websphere MQSeries Administrator
IBM WebSphere Message Broker System Admin |
|
Back to top |
|
 |
jbanoop |
Posted: Fri Jun 09, 2006 11:04 pm Post subject: |
|
|
Chevalier
Joined: 17 Sep 2005 Posts: 401 Location: SC
|
Seems ur XML has the tag called SSN while u r trying to refer to SSNTaxID in the code (InputRoot.XML.CustomerResponse.SSNTaxID)
Anoop |
|
Back to top |
|
 |
venkat kurra |
Posted: Sat Jun 10, 2006 4:00 am Post subject: |
|
|
 Master
Joined: 18 Oct 2001 Posts: 245 Location: Bloomington , IL
|
Previously i gave the reverse order...
SET OutputRoot.XML.CustomerResponse.SSNTaxID = InputRoot.XML.CustomerResponse.SSN;
also tried
SET OutputRoot.XML.SSNTaxID = InputRoot.XML.SSN;
What ever how to format this type of XML? _________________ Thanks,
Venkat Kurra
IBM Certified Specialist-MQSeries
IBM Websphere MQSeries Administrator
IBM WebSphere Message Broker System Admin |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Jun 10, 2006 4:42 am Post subject: Re: XML Format |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
venkat kurra wrote: |
Hi,
I am trying to get SSNTaxID (= SSN) from the follwoing xml message,
<?xml version="1.0" encoding="UTF-8"?><bons0:CustomerResponse xmlns:bons0="http://CRMIntegrationLibrary/Customer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://CRMIntegrationLibrary/Customer CustomerResponse.xsd "><SSN>SSN</SSN><dateOfBirth>dateOfBirth</dateOfBirth><response>response1</response></bons0:CustomerResponse>
the following statement is not working for me,
SET OutputRoot.XML.CustomerResponse.SSN = InputRoot.XML.CustomerResponse.SSNTaxID;
also tried
SET OutputRoot.XML.SSN = InputRoot.XML.CustomerResponse.SSNTaxID;
Do i need to add any additional tag? |
Try (from memory)
Code: |
declare bons0 namespace 'http://CRMIntegrationLibrary/Customer';
Set OutputRoot.XML.SSNTaxID=InputRoot.XML.bons0:CustomerResponse.SSN;
|
Read up all about the XMLNS and namespaces that's what the manuals are for.
If in doubt use a reference and move it down the tree. As you move it print out the fieldnamespace(myref) information.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Sat Jun 10, 2006 5:39 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You must use a namespace enabled parser to handle namespaces.
You can't use 'XML' for namespace enabled XML. You have to use XMLNS, or preferably XMLNSC in v6. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
venkat kurra |
Posted: Sat Jun 10, 2006 10:11 am Post subject: |
|
|
 Master
Joined: 18 Oct 2001 Posts: 245 Location: Bloomington , IL
|
Thanks ..i will look in to it.
For now it worked with the following syntax,
SET OutputRoot.XML."bons0:CustomerResponse".SSN = InputRoot.XML."bons0:CustomerResponse".SSNTaxID; _________________ Thanks,
Venkat Kurra
IBM Certified Specialist-MQSeries
IBM Websphere MQSeries Administrator
IBM WebSphere Message Broker System Admin |
|
Back to top |
|
 |
kimbert |
Posted: Mon Jun 19, 2006 1:18 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Jeff said
Quote: |
You must use a namespace enabled parser to handle namespaces.
You can't use 'XML' for namespace enabled XML. You have to use XMLNS, or preferably XMLNSC in v6. |
This is true. You may have got it 'working' for now, but your solution is fundamentally flawed. You are using a parser which is effectively deprecated, and your message flow logic is assuming that the namespace prefixes will never change. PLEASE change the parser to XMLNS ( if you're on v5 ) or XMLNSC ( if you're on v6 ). The development cost will be small, and the potential payoff will be large in both performance and future maintenance. |
|
Back to top |
|
 |
|