Author |
Message
|
smuktineni |
Posted: Tue Feb 04, 2014 1:27 pm Post subject: DFDL & xPath |
|
|
 Apprentice
Joined: 28 Aug 2003 Posts: 33 Location: Omaha
|
Input is fixed length format with some variable complex types. In below
partial schema, elements Reference and ErrorTypes occursCount is available in elements ReferenceCounter and ErrorCounter.
Code: |
<xsd:annotation>
<xsd:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:format alignment="implicit" alignmentUnits="bytes" binaryFloatRep="ieee" byteOrder="bigEndian" calendarCenturyStart="55" calendarCheckPolicy="lax" calendarDaysInFirstWeek="1" calendarFirstDayOfWeek="Sunday" calendarLanguage="en-US" calendarObserveDST="yes" calendarPattern="yyyy-MM-dd-HH.mm.ss.SSSSSS" calendarPatternKind="explicit" calendarTimeZone="UTC-06:00" choiceLengthKind="implicit" decimalSigned="no" documentFinalTerminatorCanBeMissing="yes" emptyValueDelimiterPolicy="none" encoding="{$dfdl:encoding}" escapeSchemeRef="" fillByte="%SP;" floating="no" ignoreCase="yes" initiatedContent="no" initiator="" leadingSkip="0" lengthKind="explicit" lengthUnits="characters" nilKind="literalValue" nilValue="%ES;" nilValueDelimiterPolicy="none" occursCountKind="implicit" representation="text" separator="" sequenceKind="ordered" terminator="" textBidi="no" textBooleanFalseRep="N" textBooleanJustification="left" textBooleanPadCharacter="%WSP;" textBooleanTrueRep="Y" textCalendarJustification="left" textCalendarPadCharacter="0" textNumberCheckPolicy="lax" textNumberJustification="right" textNumberPadCharacter="0" textNumberPattern="*0" textNumberRep="standard" textNumberRounding="pattern" textNumberRoundingIncrement="2.0" textNumberRoundingMode="roundHalfEven" textPadKind="padChar" textStandardBase="10" textStandardZeroRep="0" textStringJustification="left" textStringPadCharacter="%SP;" textTrimKind="none" textZonedSignStyle="asciiTranslatedEBCDIC" trailingSkip="0" truncateSpecifiedLengthString="no" useNilForDefault="yes"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType name="ReceivableHeader">
<xsd:sequence dfdl:sequenceKind="ordered">
<xsd:element default="P" dfdl:length="1" name="Action" type="tns:Actions"/>
<xsd:element default="0" dfdl:length="2" dfdl:nilValue="0" name="ChargeCounter" nillable="true" type="xsd:int"/>
<xsd:element default="0" dfdl:length="2" dfdl:nilValue="0" name="ReferenceCounter" nillable="true" type="xsd:int"/>
<xsd:element default="0" dfdl:length="2" dfdl:nilValue="0" name="ErrorCounter" nillable="true" type="xsd:int"/>
<xsd:element dfdl:lengthKind="implicit" dfdl:occursCount="{xs:nonNegativeInteger(parent::ReferenceCounter)}" dfdl:occursCountKind="expression" maxOccurs="unbounded" minOccurs="0" name="Reference" type="tns:ReceivableReference"/>
<xsd:element dfdl:lengthKind="implicit" dfdl:occursCount="{xs:nonNegativeInteger(../ErrorCounter)}" dfdl:occursCountKind="expression" maxOccurs="unbounded" minOccurs="0" name="ValidationErrors" type="tns:ErrorTypes"/>
</xsd:sequence>
</xsd:complexType> |
Tried various options for the getting the values of above using xpath
Quote: |
parent::ReferenceCounter, ../ReferenceCounter |
and ended up with the same errors. Also tried below functions with no luck yet.
Code: |
xs:nonNegativeInteger(parent::ReferenceCounter)
xs:number(parent::ReferenceCounter)
xs:int(parent::ReferenceCounter)
|
Error is
Code: |
2014-02-04 15:16:55.875880 6321 UserTrace BIP5841I: ''Offset: 296. Starting to process element 'ChargeCounter'.''
2014-02-04 15:16:55.875916 6321 UserTrace BIP5841I: ''Offset: 296. Found nil literal value for element 'ChargeCounter'. The value of the element will be reported as nil.''
2014-02-04 15:16:55.875948 6321 UserTrace BIP5841I: ''Offset: 298. Found nil literal value for element 'ChargeCounter'. The value of the element will be reported as nil.''
2014-02-04 15:16:55.875972 6321 UserTrace BIP5841I: ''Offset: 296. Found fixed length value: '06' for element 'ChargeCounter'.''
2014-02-04 15:16:55.876004 6321 UserTrace BIP5841I: ''Offset: 298. Finished processing element 'ChargeCounter'.''
2014-02-04 15:16:55.876032 6321 UserTrace BIP5841I: ''Offset: 298. Starting to process element 'ReferenceCounter'.''
2014-02-04 15:16:55.876088 6321 UserTrace BIP5841I: ''Offset: 298. Found nil literal value for element 'ReferenceCounter'. The value of the element will be reported as nil.''
2014-02-04 15:16:55.876116 6321 UserTrace BIP5841I: ''Offset: 300. Found nil literal value for element 'ReferenceCounter'. The value of the element will be reported as nil.''
2014-02-04 15:16:55.876144 6321 UserTrace BIP5841I: ''Offset: 298. Found fixed length value: '00' for element 'ReferenceCounter'.''
2014-02-04 15:16:55.876188 6321 UserTrace BIP5841I: ''Offset: 300. Finished processing element 'ReferenceCounter'.''
2014-02-04 15:16:55.876220 6321 UserTrace BIP5841I: ''Offset: 300. Starting to process element 'ErrorCounter'.''
2014-02-04 15:16:55.876256 6321 UserTrace BIP5841I: ''Offset: 300. Found nil literal value for element 'ErrorCounter'. The value of the element will be reported as nil.''
2014-02-04 15:16:55.876280 6321 UserTrace BIP5841I: ''Offset: 302. Found nil literal value for element 'ErrorCounter'. The value of the element will be reported as nil.''
2014-02-04 15:16:55.876312 6321 UserTrace BIP5841I: ''Offset: 300. Found fixed length value: '00' for element 'ErrorCounter'.''
2014-02-04 15:16:55.876344 6321 UserTrace BIP5841I: ''Offset: 302. Finished processing element 'ErrorCounter'.''
2014-02-04 15:16:55.876452 6321 UserTrace BIP5843E: ''Cannot resolve expression '{xs:nonNegativeInteger(parent::ReferenceCounter)}' for DFDL property 'occursCount' defined on object '#xmlns(p="http://accounting.abcd.com/Billing")xscd(/type::p:ReceivableHeader/model::sequence/schemaElement::p:Reference)'.''
2014-02-04 15:16:55.876500 6321 UserTrace BIP5809E: The DFDL parser signalled that an error occurred when processing a DFDL schema. The message from the DFDL parser is: 'CTDP3085E: Cannot resolve expression '{xs:nonNegativeInteger(parent::ReferenceCounter)}' for DFDL property 'occursCount' defined on object '#xmlns(p="http://accounting.abcd.com/Billing")xscd(/type::p:ReceivableHeader/model::sequence/schemaElement::p:Reference)'.'
A DFDL schema error occurred during the parsing of a DFDL message.
Review and resolve the problems indicated in the message from the DFDL parser.
|
What would be the right xpath expression and function to get the values of those counters to set on occurscount? Or is my DFDL wrong? _________________ -Satish |
|
Back to top |
|
 |
dogorsy |
Posted: Tue Feb 04, 2014 11:28 pm Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
see:
Code: |
17.1 Example: 2d Nested Array |
in "Data Format Description Language (DFDL) v1.0 Specification"
Search for "DFDL expressions" (1st hit in the infocentre) |
|
Back to top |
|
 |
kimbert |
Posted: Wed Feb 05, 2014 1:52 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
You have encountered a known defect. Please open a PMR with IBM and request APARs 97646 and 97905. Please ensure that you reference this thread in the PMR problem description. _________________ 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 |
|
 |
smuktineni |
Posted: Wed Feb 05, 2014 8:49 am Post subject: |
|
|
 Apprentice
Joined: 28 Aug 2003 Posts: 33 Location: Omaha
|
Thank you Kimbert for poiting to the APAR's Will open PMR. Both APAR's are scheduled to release with FP4 scheduled end of this month. Tx again
@dogorsy Yep I looked at the DFDL spec and xpath and all solutions that I tried to resolve were throwing similar error as listed above. Some posts dated back to 2012 had similar xpath references and they said it worked, so I didn't even look into APAR's! _________________ -Satish |
|
Back to top |
|
 |
dogorsy |
Posted: Wed Feb 05, 2014 8:56 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
smuktineni wrote: |
Thank you Kimbert for poiting to the APAR's Will open PMR. Both APAR's are scheduled to release with FP4 scheduled end of this month. Tx again
@dogorsy Yep I looked at the DFDL spec and xpath and all solutions that I tried to resolve were throwing similar error as listed above. Some posts dated back to 2012 had similar xpath references and they said it worked, so I didn't even look into APAR's! |
yes, APAR is scheduled to be released FP4, but if you open a a PMR you can get a fix before that. |
|
Back to top |
|
 |
|