[jdom-interest] validation across multiple namespaces

Brian Ales bka202 at yahoo.com
Wed Apr 2 18:47:49 PST 2003


HiI know this the JDOM forum, but I' am stumped - I'm trying to validate a schema (just as an XML document) that imports a namespace, and I'm only having partial success.  My problem is not with the S4S namespace, it's with the namespace defined in the import element for the 'xbrli' prefix (see below). Put simply, if you look at my schema snippet (see below), when I mispell 'debit', the parser goes and gets the correct schema and correctly sees it's not in the ennumeration for that attribute.  Great.  However, I can mispell 'balance' and Xerces 2.4.0 doesn't complain at all - shouldn't it have a problem with an attribute name ('bXXlance') that isn't defined in the schema for the namespace defined by the xbrli: prefix? Here's the relevant code for my parser (via a JDOM SaxBuilder):                SAXBuilder builder = new SAXBuilder("org.apache.xerces.parsers.SAXParser", true);                 builder.setFeature("http://apache.org/xml/features/validation/schema", true);        
                           //I'm using a scemaLocation Property to override the document hints.               schemaLocs[0] = ".\\XMLSchema.xsd";         //I have a local copy
               schemaLocs[1] = "http://www.xbrl.org/2001/xbrl-instance.xsd";               builder.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", schemaLocs);  //only jaxp seems to work
 Here's a portion of the schema I'm trying to validate (see the last attribute in the 'element' element - that's what I'm breaking to test validation): <?xml version="1.0" encoding="utf-8"?>
<!-- Taxonomy based on XBRL standard v.2.  Created by UBmatrix Taxonomy Builder 5.0.76.  Contact www.ubmatrix.com -->
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xbrli="http://www.xbrl.org/2001/instance"     xmlns:link="http://www.xbrl.org/2001/XLink/xbrllinkbase" xmlns:xlink="http://www.w3.org/1999/xlink"     xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:iascf-pfs="http://www.xbrl.org/taxonomy/int/fr/ias/ci/pfs/2002-11-15"         targetNamespace="http://www.xbrl.org/taxonomy/int/fr/ias/ci/pfs/2002-11-15" elementFormDefault="qualified">
<annotation>
    <appinfo>
      <link:linkbaseRef xlink:type="simple" xlink:href="ias-ci-pfs-2002-11-15-references.xml" xlink:actuate="onRequest"             xlink:role="http://www.xbrl.org/linkprops/linkRef/reference"             xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" />
    </appinfo>
  </annotation>
  <import namespace="http://www.xbrl.org/2001/instance" schemaLocation="http://www.xbrl.org/2001/xbrl-instance.xsd" />
  <element id="iascf-pfs_WorkProgress" name="WorkProgress" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item"     xbrli:balance="debit" />  Any help would be greatly appreciated!Thanks in advance,Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20030402/b73b92d6/attachment.htm


More information about the jdom-interest mailing list