?
Solved

newbie to XML schema- simple problem

Posted on 2003-03-26
10
Medium Priority
?
576 Views
Last Modified: 2013-11-19
When i tried to validate my xml file with xml schema validator it shows error in schemaLocation attribute.It could be a very basic error as i am new to XML schema.

xml file - wipro_instance_document.xml

<?xml version="1.0" encoding="utf-8"?>
<group xmlns="http://www.xbrl.org/2001/instance" xsi:schemaLocation="http://www.wipro.com/xbrl/ wipro.xsd" xmlns:ISO4217="http://www.iso.ch" xmlns:link="http://www.xbrl.org/2001/XLink/xbrllinkbase" xmlns:usfr-pt="http://www.wipro.com/xbrl" xmlns:xbrli="http://www.xbrl.org/2001/instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >

<usfr-pt:CashCashEquivalents numericContext="Sep30-2001" >  6332194
</usfr-pt:CashCashEquivalents>
<usfr-pt:AccountsReceivableTradeNet numericContext="Sep30-2001" >5126564
</usfr-pt:AccountsReceivableTradeNet>
<numericContext id="Sep30-2001" precision="18" cwa="false" >
<entity><identifier scheme="http://www.wipro.com">wipro</identifier><segment /></entity>
<period><instant>2001-09-30</instant></period>
<unit><measure>ISO4217:INR</measure></unit></numericContext>
</group>


XSD file - wipro.xsd

<schema targetNamespace="http://www.wipro.com/xbrl" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:link="http://www.xbrl.org/2001/XLink/xbrllinkbase" xmlns:usfr-pt="http://www.wipro.com/xbrl" xmlns:xbrli="http://www.xbrl.org/2001/instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" elementFormDefault="qualified" >
<import namespace="http://www.xbrl.org/2001/instance" schemaLocation="http://www.xbrl.org/Core/2002-01-09/xbrl-instance.xsd" /><import namespace="http://www.xbrl.org/2001/XLink/xbrllinkbase" schemaLocation="http://www.xbrl.org/Core/2002-01-09/xbrl-linkbase.xsd" /><annotation>
<appinfo>
<xlink:linkbaseRef xlink:type="simple" xlink:href="wipro_reference.xml" xlink:role="http://www.xbrl.org/linkprops/linkRef/reference" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" ></xlink:linkbaseRef>
<xlink:linkbaseRef xlink:type="simple" xlink:href="wipro_label.xml" xlink:role="http://www.xbrl.org/linkprops/linkRef/label" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" ></xlink:linkbaseRef>
<xlink:linkbaseRef xlink:type="simple" xlink:href="wipro_calculation.xml" xlink:role="http://www.xbrl.org/linkprops/linkRef/calculation" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" ></xlink:linkbaseRef>
<xlink:linkbaseRef xlink:type="simple" xlink:href="wipro_presentation.xml" xlink:role="http://www.xbrl.org/linkprops/linkRef/presentation" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" ></xlink:linkbaseRef>
<xlink:linkbaseRef xlink:type="simple" xlink:href="wipro_definition.xml" xlink:role="http://www.xbrl.org/linkprops/linkRef/definition" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" ></xlink:linkbaseRef>
</appinfo>
</annotation>
<element id="CashCashEquivalents" name="CashCashEquivalents" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" ></element>
<element id="AccountsReceivableTradeNet" name="AccountsReceivableTradeNet" type="xbrli:monetaryItemType" substitutionGroup="xbrli:item" ></element>
</schema>

Thanks in advance,
rushtoamit
0
Comment
Question by:rushtoamit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 6

Expert Comment

by:Wayne Bradney
ID: 8247354
rushtoamit,

Actually, just posting the XML seems to have highlighted the problem:

xsi:schemaLocation="http://www.wipro.com/xbrl/ wipro.xsd"

There's a space in your schemaLocation URI. Take it out and see if that works.

Regards,
WMB
0
 
LVL 6

Expert Comment

by:Wayne Bradney
ID: 8247402
rushtoamit,

Forget what I said - I misread your directive as xsi:noNamespaceSchemaLocation

So I think the problem instead may be the extra "/" at the end of the namespace part of schemaLocation. Your target namespace appears to be:

http://www.wipro.com/xbrl (without the trailing "/")

Regards,
WMB
0
 

Author Comment

by:rushtoamit
ID: 8258747
This is the root element of schema file(wipro.xsd) that i have.

<schema targetNamespace="http://www.wipro.com/xbrl" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:link="http://www.xbrl.org/2001/XLink/xbrllinkbase" xmlns:usfr-pt="http://www.wipro.com/xbrl" xmlns:xbrli="http://www.xbrl.org/2001/instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" elementFormDefault="qualified" >
<import namespace="http://www.xbrl.org/2001/instance" schemaLocation="http://www.xbrl.org/Core/2002-01-09/xbrl-instance.xsd" /><import namespace="http://www.xbrl.org/2001/XLink/xbrllinkbase" schemaLocation="http://www.xbrl.org/Core/2002-01-09/xbrl-linkbase.xsd" />
</schema>

Following is the error code that is generated by XBRL document validator.XBRL document is nothing but XML document with Financial tags and taxonomies are schema files.I once again mention it could be a very basic error.

ID-Code-Message  1 - 1012 - Success
Description  The input document 'D:\InetPub\xbrlInstanceValidator\temp\3145329840375038.5\wipro_instance_document.xml' has well-formed XML format.  
Location  
*
ID-Code-Message  2 - 1013 - Success
Description  The document 'D:\InetPub\xbrlInstanceValidator\temp\3145329840375038.5\wipro_instance_document.xml' has well-formed XBRL format (no DTD is referred).  
Location  
*
ID-Code-Message  3 - 1005 - Warning
Description  The root group element of the instance document does not have the 'schemaLocation' attribute  
Location  group {unknown}  
*
ID-Code-Message  4 - 1007 - Fatal Error
Description  No taxonomies are loaded. The validation process is stopped.  
Location  
0
CHALLENGE LAB: Troubleshooting Connectivity Issues

Goal: Fix the connectivity issue in the lab's AWS environment so that you can SSH into the provided EC2 instance.  

 

Author Comment

by:rushtoamit
ID: 8258767
This error still exists even after removing / in schemaLocation attribute.
0
 
LVL 6

Expert Comment

by:Wayne Bradney
ID: 8262391
rushtoamit,

I can't get to either of these schemas from a browser:

http://www.xbrl.org/Core/2002-01-09/xbrl-instance.xsd
http://www.xbrl.org/Core/2002-01-09/xbrl-linkbase.xsd

So chances are the parser can't either. Sure enough, when I ran your files through Xerces I got:

17605 [main] WARN com.wss.xml.Validate-org.xml.sax.SAXParseException: src-import.0: Failed to read imported schema document 'http://www.xbrl.org/Core/2002-01-09/xbrl-instance.xsd'. [line 11, position 83]

So a declaration of the <group> element is not available.

Bear in mind also that schemaLocation is only a hint to the parser. Parser implementations don't have to honour the schemaLocation attribute. See the spec at http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#element-import for more details.

I don't know anything about the XBRL document validator, but if it does honour schemaLocation it might not be able to load the xbrl-instance.xsd schema.

Regards,
WMB
0
 

Author Comment

by:rushtoamit
ID: 8266843
I have changed the import statement.These links will work now.But the errors are still the same as mentioned in the previous posting.

This is schema file named us-gaap-ci-2001-12-31-xbrl.xsd

<schema targetNamespace="http://www.xbrl.org/us/gaap/ci/2001/us-gaap-ci-2001" xmlns:ci="http://www.xbrl.org/us/gaap/ci/2001/us-gaap-ci-2001" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xbrl="http://www.xbrl.org/2001/instance" elementFormDefault="qualified">
<import namespace="http://www.xbrl.org/2001/instance" schemaLocation="http://www.xbrl.org/2001/xbrl-instance.xsd"/>
<import namespace="http://www.xbrl.org/2001/XLink/xbrllinkbase" schemaLocation="http://www.xbrl.org/2001/xbrl-linkbase.xsd"/>
</schema>

This is schema file named wipro_custom.xsd

<schema targetNamespace="http://www.wipro.com/xbrl" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:wt="http://www.wipro.com/xbrl" xmlns:link="http://www.xbrl.org/XLink/xbrllinkbase" xmlns:xbrli="http://www.xbrl.org/2001/instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" elementFormDefault="qualified" xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd" >
<import namespace="http://www.xbrl.org/2001/instance" schemaLocation="http://www.xbrl.org/2001/xbrl-instance.xsd"/>
<import namespace="http://www.xbrl.org/2001/XLink/xbrllinkbase" schemaLocation="http://www.xbrl.org/2001/xbrl-linkbase.xsd"/>
</schema>

This is root(group)element of wipro_instance_document.xml

group xmlns="http://www.xbrl.org/2001/instance" xmlns:ci="http://www.xbrl.org/us/gaap/ci/2001/us-gaap-ci-2001" xmlns:wt="http://www.wipro.com/xbrl" xmlns:link="http://www.xbrl.org/2001/XLink/xbrllinkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xbrl.org/2001/instance http://www.xbrl.org/2001/xbrl-instance.xsd http://www.wipro.com/xbrl wipro_custom.xsd http://www.xbrl.org/us/gaap/ci/2001/us-gaap-ci-2001 us-gaap-ci-2001-12-31-xbrl.xsd" >
</group>

I tried to remove schemalocation attribute in the Group element of the wipro_instance_document.xml.But nothing changed.
Thanks in advance,
Amit Gupta

0
 
LVL 6

Expert Comment

by:Wayne Bradney
ID: 8270474
rushtoamit,

OK, I've pulled together all the required schemata and run them all through Xerces, and I get this:

0 [main] ERROR com.wss.xml.Validate  - org.xml.sax.SAXParseException: cos-nonamb
ig: "http://www.xbrl.org/2001/instance":scenario and WC[##any] (or elements from
 their substitution group) violate "Unique Particle Attribution". [line 161, pos
ition 16]
81 [main] ERROR com.wss.xml.Validate  - org.xml.sax.SAXParseException: cos-nonam
big: "http://www.xbrl.org/2001/instance":segment and WC[##any] (or elements from
 their substitution group) violate "Unique Particle Attribution". [line 151, pos
ition 16]
151 [main] ERROR com.wss.xml.Validate  - org.xml.sax.SAXParseException: cos-nona
mbig: "http://www.xbrl.org/2001/instance":startDate and "http://www.xbrl.org/200
1/instance":startDate (or elements from their substitution group) violate "Uniqu
e Particle Attribution". [line 114, position 33]

What this means is that the xbrl schemata are non-determinstic (they violate the XMLSchema spec's UPA rule), so a standard validating parser won't be able to validate it. Maybe the "XBRL validator" makes allowances for this - I don't know.

Is this the same error you're getting from the "XBRL validator" or are you still getting the "Can't load schema" error? Have you tried validating with a different validator (XML Spy, for instance)?

Regards,
WMB
0
 

Author Comment

by:rushtoamit
ID: 8283152
Hi wbradney,
Yup,it is still showing the same schemlocaion error.Can you give me the link of some good schema validaion tool,so that i an check for myself.What this UPA error means?
Thanks in advance,
rushtoamit
0
 
LVL 6

Accepted Solution

by:
Wayne Bradney earned 150 total points
ID: 8284277
rushtoamit,

I use Xerces-J from the Apache group, since it's free and closely conforms to the XMLSchema spec. I've heard that XML-Spy is quite good, but I've never used it. There's also Microsoft's MSXML.

For details on the Unique Particle Attribution constraint, see Section 3.8.6 (http://www.w3.org/TR/xmlschema-1/#coss-modelGroup) and Appendix H (http://www.w3.org/TR/xmlschema-1/#non-ambig) of the spec.

Basically, the UPA rule ensures that the parser is always able to determine the order in which to expect elements in the instance document, based on the schema, without looking ahead in the document. If it can't, the schema is said to be 'non-deterministic'. A non-deterministic schema is quite difficult to validate against in constant time using a finite state machine implementation, so for performance reasons the UPA constraint is enforced by most parsers.

There are alternative schema languages that allow more flexibility in schema design: eg. Relax, Schematron, but I don't have any direct experience of these.

Regards,
WMB
0
 

Author Comment

by:rushtoamit
ID: 8412544
hi Wmb,
XBRL does not imposes any restriction on order of elements.
By the way,error was due to some XBRL concept.
Thanx a lot,
Amit
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question