[ 
https://issues.apache.org/jira/browse/XMLSCHEMA-35?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14124565#comment-14124565
 ] 

Michael Pigott commented on XMLSCHEMA-35:
-----------------------------------------

Hi Martin,
    I'm not sure if you want me to reply to either the dev mailing list, the 
JIRA ticket, or both - so I'll reply to both.  The specific problem I'm having 
is I want to parse XBRL documents.  XBRL is an XML format for companies to 
report their quarterly & annual financial reports in, with the intent of making 
it easier for government agencies to detect fraudulent statements.
   The base XBRL schema is here: 
http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd.  It contains the 
following import statement:

<import namespace="http://www.xbrl.org/2003/linkbase"; 
schemaLocation="xbrl-linkbase-2003-12-31.xsd"/>

As expected, the XML Schema for the linkbase namespace can be found at 
http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd.  So far so good.

However, the Securities and Exchange Commission (the U.S. regulatory agency for 
companies on the stock market) defines their own extensions to the XBRL Schema 
here: http://xbrl.fasb.org/us-gaap/2013/elts/us-gaap-2013-01-31.xsd

This XML Schema contains multiple import statements, including:

<xs:import namespace="http://www.xbrl.org/2003/instance"; 
schemaLocation="http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd"/>
<xs:import namespace="http://fasb.org/us-types/2013-01-31"; 
schemaLocation="us-types-2013-01-31.xsd"/>

Now we have a problem.  The following schemas need to be reached:

http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd
xbrl-linkbase-2003-12-31.xsd (base URI of http://www.xbrl.org/2003/)
http://xbrl.fasb.org/us-gaap/2013/elts/us-gaap-2013-01-31.xsd
us-types-2013-01-31.xsd (Base URI of http://xbrl.fasb.org/us-gaap/2013/elts/)

This is the problem I ran into, that XmlSchemaMultiBaseUriResolver solves.

Thanks,
Mike

> Multiple-Base URI Resolver
> --------------------------
>
>                 Key: XMLSCHEMA-35
>                 URL: https://issues.apache.org/jira/browse/XMLSCHEMA-35
>             Project: XmlSchema
>          Issue Type: New Feature
>    Affects Versions: 2.1.0
>            Reporter: Michael Pigott
>              Labels: PatchAvailable
>             Fix For: 2.1.1
>
>         Attachments: diff_multi_base_uri_resolver.zip
>
>
> When working with schemas across multiple namespaces and source URIs, 
> multiple XML Schemas may be given relative paths, but DefaultURIResolver only 
> supports one base URI.
> XmlSchemaMultiBaseUriResolver collects the base URIs of all schemas 
> encountered, and when a relative path is requested, will search all of the 
> base URIs looking for the XML Schema.  This search is conducted in 
> reverse-chronological-order of base-URI-added.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to