Validating XML via pubschemavalidate

Peers

Appreciate any inputs here, I am stuck with this for 2 days and still have no idea what the problem is

Attached please find a zip files contains the XSD for my XML files

XSD Schema File
xmlschema Version 1.7.zip (17.9 k)

In addition, attached please find the XML that I have (at the end)

Using XMLSpy and other XML Editor, I am able to validate the XML against
the XSD (layout.xsd) without any error

However, when doing it within webMethods

  1. Create a Document Type “SubmissionDT” in Developer based on the
    layout.xsd -> Root Element Submission
    Will create a schema schema_SubmissionDT by webMethods
  2. Create a Flow Services
    2.1 xmlStringToXMLNode <- passing in the XML as xmldata
    <- isXML set to true
    2.2 xmlNodeToDocument -> output document to Document
    Type “SubmissionDT”
    2.3 invoke pub.schema:validate <- passing in “SubmissionDT” to
    objects
    <- set confirmsTo to the documentType
    definition “SubmissionDT”

However, keep complaing the Submission/T619/TRNMTR_ADDR/cntry_Cd

Appreciate help here !!Completely lost

XML File
T5XMITXML.zip (4.7 k)

RMG,

Thanks a lot

The field <cntry_cd> is defined as countryType (simple.xsd)

**<xsd:simpletype>
**<xsd:restriction>
**<xsd:pattern>
**</xsd:restriction>
**</xsd:simpletype>

The pattern is defined as p{L}{3}|p{N}{3} (I skip the slash since it won’t display properly)

It should be any 3 Letters or any 3 numbers (if I understand the
regular expression right)

and <cntry_cd>CAN</cntry_cd> should be valid

Comments please

Steven,

you are right and i do understand that pattern(p{L}{3}|p{N}{3}) and <cntry_cd>CAN</cntry_cd> should be valid ,but still i dont understand why the schema validate service is showing as the error…

So i will again investigate on this and let you know if i come with any resolution.

Regards,

RMG

FYI. I am using weBMethods 6.0.1 SP2 with the following fixes applied

IS_6-0-1_Fix65
IS_6-0-1_Fix69
IS_6-0-1_SP2_Fix114
IS_6-0-1_SP2_Fix126
IS_6-0-1_SP2_Fix133
IS_6-0-1_SP2_Fix73
IS_6-0-1_SP2_Fix74
IS_6-0-1_SP2_Fix77
IS_6-0-1_SP2_Fix80
IS_6-0-1_SP2_Fix84
WmPRT_6-0-1_Fix13
WmPRT_6-0-1_Fix16
WmPRT_6-0-1_Fix14
WmPRT_6-0-1_Fix18
IS_6-0-1_SP2
IS_6-0-1_SP2_Fix118
TNS_6-0-1_Fix11
TNS_6-0-1_Fix18
TNS_6-0-1_Fix2
TNS_6-0-1_Fix26
TNS_6-0-1_Fix6
TNS_6-0-1_Fix8

RMG,

1 more interesting findings.

By setting ignoreContent = “true” and validating against the document Type, then there is no errors

However, if I use the *node object from xmlStringToXMLNode and use
it to call pub.validate:schema and validating against the schema
created by webMethods (automatically when you create a document type based on XSD), webmethods returns back with errors

errors
error[0]
pathName /Submission/T619/
errorCode NV-009
errorMessage [ISC.0082.9009] Child element sbmt_ref_id {}
at position 0 is unexpected

which I don’t understand why the element sbmt_ref_id should be a problem

Is that because my XSD is 2001 specification vs the old 1999

Really confused now

Steven,

I have noticed this behaviour in the first test attempt itself.

By setting ignoreContent = “true” and validating against the document Type, then there is no errors

Actually i told you about this info in my earlier post if you observe my post carefully.

It is better the XSD file should be 2001 specification based on the webMethods parsing/validation behaves.

If the validation is causing pain against the Schema and giving strange errors,please contact tech support and report this issue.

HTH,