Skip to main content
Participant
May 16, 2011
Question

validating XML against schema with imports

  • May 16, 2011
  • 1 reply
  • 2146 views

I've been trying to validate the XML document located at

http://flintbox.com/static/api/examples/patents_example.xml

against the schema located at

http://flintbox.com/static/api/flintbox-collection.xsd

in ColdFusion 9 using the code

<cfset results=xmlvalidate(""http://flintbox.com/static/api/examples/patents_example.xml",
       "http://flintbox.com/static/api/sample-collection.xsd")>
<cfoutput>
<cfdump var="#results#">
</cfoutput>

When I do so, I observe the following errors:

                 [Error] :4:41: src-import.3.1: The namespace attribute,     
               1 'urn:us:gov:uspto:pair', of an <import> element information 
                 item must be identical to the targetNamespace attribute,    
                 'null', of the imported document.                           
               2 [Error] :181:43: src-resolve: Cannot resolve the name       
   errors        'uspto:Country' to a(n) 'element declaration' component.    
                 [Error] :18:48: cvc-complex-type.2.4.d: Invalid content was 
               3 found starting with element 'Country'. No child element is  
                 expected at this point.                                     
                 [Error] :25:48: cvc-complex-type.2.4.d: Invalid content was 
               4 found starting with element 'Country'. No child element is  
                 expected at this point.

I am able to successfully validate the document against the schema at http://www.xmlforasp.net/SchemaValidator.aspx, however.

In the past, ColdFusion's XML validation mechanism seems to have had issues with schemas that contain imports, e.g., http://forums.adobe.com/message/155906. Have these issues still not been resolved?

This topic has been closed for replies.

1 reply

Inspiring
May 17, 2011

In the past, ColdFusion's XML validation mechanism seems to have had issues with schemas that contain imports, e.g., http://forums.adobe.com/message/155906. Have these issues still not been resolved?

Do you not think that perhaps you're answering your own question here?

I don't see an issue about this on the bug tracker.  It might be an idea if you can get a simple, stand-alone repro case together and raise an issue (and post the reference back here and against that other thread so people know to vote for it).  If you post the repro case here too, it would be helpful.

--

Adam