Author |
Message
|
Ashok Kumar |
Posted: Thu Jul 17, 2014 11:45 am Post subject: Reading XMl Data using ESQL |
|
|
Acolyte
Joined: 01 Jul 2013 Posts: 53
|
Hello WMB Developers,
I am unable to read the <common:Prefix>xxx</common:Prefix> data using ESQL in compute node.
below file is input file.
Code: |
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XML Spy v4.4 U
(http://www.xmlspy.com)-->
<RtrvEligBnftInfoRequest xmlns="urn:rtrveligbnftinfo1_0.elig.schema.bcbsm.com"
xmlns:common="urn:common2_0.schema.bcbsm.com"
xmlns:mbr="urn:mbr2_1.schema.bcbsm.com"
xmlns:meta="urn:meta1_1.schema.bcbsm.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:rtrveligbnftinfo1_0.elig.schema.bcbsm.com
D:\Aparna\Elig\elig\RtrvEligBnftInfoTypes-v1.1.xsd">
<meta:ReqHeaderArea systemEnvironmentCode="PROD">
<meta:VersionInfo>
<meta:ServiceVersion>1.1</meta:ServiceVersion>
<meta:SchemaVersion>1.0.1</meta:SchemaVersion>
</meta:VersionInfo>
<meta:CreationDateTime>2001-12-17T09:30:47-05:00</meta:CreationDateTime>
<meta:MessageID>String</meta:MessageID>
<meta:Consumer>
<meta:ID>String</meta:ID>
<meta:Name>String</meta:Name>
</meta:Consumer>
</meta:ReqHeaderArea>
<PayloadArea>
<ContractSource>BX</ContractSource>
<LOBInd>P</LOBInd>
<ProvAuthRequiredInd>Y</ProvAuthRequiredInd>
<ProviderInfo>
<Name>
<common:Prefix>xxx</common:Prefix>
<common:First>John1</common:First>
<common:Last>Brown1</common:Last>
<common:Middle>xxx</common:Middle>
<common:Suffix>cccc</common:Suffix>
</Name>
<NPI>String</NPI>
<Address>
<common:Street></common:Street>
<common:City>Vizag</common:City>
<common:County>USA</common:County>
<common:StateProvince>String</common:StateProvince>
<common:PostalCode>String</common:PostalCode>
<common:Country>String</common:Country>
</Address>
</ProviderInfo>
<ContractNumber>String</ContractNumber>
<ReqMemberInfo>
<SubscriberInd>345678901</SubscriberInd>
<Name>
<common:Prefix>String</common:Prefix>
<common:First>String</common:First>
<common:Last>String</common:Last>
<common:Middle>String</common:Middle>
<common:Suffix>String</common:Suffix>
</Name>
<Address>
<common:Street>220 TrowBridge Rd</common:Street>
<common:City>East Lancing</common:City>
<common:County>USA</common:County>
<common:StateProvince>Michigan</common:StateProvince>
<common:PostalCode>48824</common:PostalCode>
<common:Country>String</common:Country>
</Address>
<DateOfBirth>1967-08-13</DateOfBirth>
<GenderIndicator>M</GenderIndicator>
<BirthSeqenceNumber>0</BirthSeqenceNumber>
<DiagnosisCode>
<ICD9>780</ICD9>
</DiagnosisCode>
<TaxonomyCode>282N00000X</TaxonomyCode>
<ReqAdditionalID>
<PolicyNumber>Q123456X</PolicyNumber>
<MemberIDNumber> HTW12345601</MemberIDNumber>
<CaseNumber></CaseNumber>
<PatientAccountNumber>334</PatientAccountNumber>
<IssueNumber>21</IssueNumber>
<PlanNumber>201A</PlanNumber>
<Group>
<mbr:Number>1234567</mbr:Number>
<mbr:Suffix>test</mbr:Suffix>
</Group>
</ReqAdditionalID>
<IndRelationshipCode>01</IndRelationshipCode>
<ReqMemberDate>
<IssueDate>1967-08-13</IssueDate>
<Plan>
<common:StartDate>2014-08-14</common:StartDate>
<common:EndDate>2016-08-14</common:EndDate>
</Plan>
</ReqMemberDate>
</ReqMemberInfo>
<ServiceTypeCode>30</ServiceTypeCode>
</PayloadArea>
</RtrvEligBnftInfoRequest> |
|
|
Back to top |
|
 |
ganesh |
Posted: Thu Jul 17, 2014 11:52 am Post subject: |
|
|
Master
Joined: 18 Jul 2010 Posts: 294
|
Where is your code which is trying to access the element? |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jul 17, 2014 12:01 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I am unable to read the <common:Prefix>xxx</common:Prefix> data using ESQL in compute node. |
What have you tried? And what happened. Please give details, else we cannot help. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
Ashok Kumar |
Posted: Thu Jul 17, 2014 12:09 pm Post subject: |
|
|
Acolyte
Joined: 01 Jul 2013 Posts: 53
|
I have written ESQl code for <common:Prefix>xxx</common:Prefix> like
InputRoot.XMLNSC.RtrvEligBnftInfoRequest.PayloadArea.ProviderInfo.Name.common:Prefix |
|
Back to top |
|
 |
ganesh |
Posted: Thu Jul 17, 2014 12:16 pm Post subject: |
|
|
Master
Joined: 18 Jul 2010 Posts: 294
|
Are you getting any error and have you defined the namespace for common ? |
|
Back to top |
|
 |
Ashok Kumar |
Posted: Thu Jul 17, 2014 12:34 pm Post subject: |
|
|
Acolyte
Joined: 01 Jul 2013 Posts: 53
|
I have declared namespace as like this
DECLARE common NAMESPACE 'urn:common2_0.schema.bcbsm.com'; |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jul 17, 2014 1:36 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Code: |
xmlns="urn:rtrveligbnftinfo1_0.elig.schema.bcbsm.com" |
The entire document ( well, every tag and attribute that does not have a prefix ) is in the namespace "urn:rtrveligbnftinfo1_0.elig.schema.bcbsm.com". So you will need to DECLARE another namespace constant, and use it on the other fields in your field reference. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
smdavies99 |
Posted: Thu Jul 17, 2014 9:31 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
If you use UserTrace and examine the output you will see which element in your ESQL statement fails. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jul 18, 2014 4:31 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Ashok Kumar wrote: |
I have written ESQl code for <common:Prefix>xxx</common:Prefix> like
InputRoot.XMLNSC.RtrvEligBnftInfoRequest.PayloadArea.ProviderInfo.Name.common:Prefix
|
Assuming dfn is you default namespace you'd need something like this to access the Prefix...
Code: |
InputRoot.XMLNSC.dfn:RtrvEligBnftInfoRequest.dfn:PayloadArea.dfn:ProviderInfo.dfn:Name.common:Prefix |
ESQL knows no default namespace. Namespaces have to be explicitely mentioned at each and every level of the tree.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Ashok Kumar |
Posted: Fri Jul 18, 2014 4:50 am Post subject: |
|
|
Acolyte
Joined: 01 Jul 2013 Posts: 53
|
I have declared namespaces using ESQL like
DECLARE xmlns NAMESPACE 'urn:rtrveligbnftinfo1_0.elig.schema.bcbsm.com';
DECLARE common NAMESPACE 'urn:common2_0.schema.bcbsm.com';
DECLARE mbr NAMESPACE 'urn:mbr2_1.schema.bcbsm.com';
DECLARE meta NAMESPACE 'urn:meta1_1.schema.bcbsm.com';
DECLARE schemaLocation NAMESPACE 'urn:rtrveligbnftinfo1_0.elig.schema.bcbsm.com';
DECLARE xsi NAMESPACE 'http://www.w3.org/2001/XMLSchema-instance';
DECLARE a CHARACTER InputRoot.XMLNSC.RtrvEligBnftInfoRequest.PayloadArea.ProviderInfo.Name.common:Prefix; |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jul 18, 2014 5:28 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Ashok Kumar wrote: |
I have declared namespaces using ESQL like
DECLARE xmlns NAMESPACE 'urn:rtrveligbnftinfo1_0.elig.schema.bcbsm.com';
|
This is blatantly wrong.
Known namespaces like xmlns, xsi, etc should never be defined in any other way than the way they are defined by the regulatory board (w3c.org?)
What you should be doing instead of trying to redefine the xmlns prefix namespace is defining a default namespace prefix like
Code: |
DEFINE dfltns NAMESPACE 'urn:rtrveligbnftinfo1_0.elig.schema.bcbsm.com'; |
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
|