Hi!
I actually have two separate problems that are probably not related.
-
How do I validate an incoming xml document, when it uses namespace prefixes? I have imported and XML Schema and a created a number of Records based on that same XML Schema. Later, when I convert the incoming XML doc to a record (using nsDecl in the service), all the records are prefixed. I assume this is correct, but the Record definition does not have the prefixes. The validation fails already on the root element. Even if I get this to work, how can I actually work with the record after that. As I understand it, each submitter is free to use whichever prefix they want, as long as it is declared in the header. How is this supposed to work?
-
A second problem is when I validate the xml document by refering directly to the webM schema, and not the Record definition (passing the node object instead of the Record). This seems to work better than validating the record, but it stops on an element requiring a gDay value. No matter what I put in there, it fails the validation. Of course, even if I get THIS to work I still have the problem of working with the Record (I need to do some transformations, among other things).
Here is a simplified version of my XML Schema:
<?xml version="1.0" encoding="UTF-8"?><xs:schema targetNamespace=“http://domain_name/b2b/2002/schemas” xmlns:ep=“http://domain_name/b2b/2002/schemas” xmlns:xs=“XML Schema” elementFormDefault=“qualified” attributeFormDefault=“qualified”>
<xs:element name=“SomeRoot”>
xs:complexType
xs:sequence
<xs:element name=“aDay”>
xs:simpleType
<xs:restriction base=“xs:gDay”>
<xs:pattern value=“[0-9]{2}”/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
And here is a sample XML doc:<?xml version="1.0" encoding="UTF-8"?>
<bp:SomeRoot xmlns:bp=“http://domain_name/b2b/2002/schemas” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=“http://domain_name E:\Standards\SAMA\test.xsd”>
bp:aDay11</bp:aDay>
</bp:SomeRoot>
The xml doc validates successfuly in other tools.