how to validate two XML against XSD?

R

Rushi

Hi All,

Is it possible to Validate XML against XSD using two different XML
files.

scenario:
There are two different XML file, one file contain element and count
information and other one contain name and other information like
color, weight etc.....
They are linked by XLink...

Below are two files Testing-Element.xml and Testing-View.xml.

Now element file contain element information like id and count. And
linkbasefile (Testing-View.xml) contain display information.

Now I want to generate a XML Schema, which will validate for a
particular element count is less then 10 then color must be red
otherwise color must be blue.

Notice: there is no any import xml working here.

<!-- Testing-Element.xml -->
<?xml version="1.0" encoding="utf-8"?>
<appinfo>
<link:linkbaseRef xlink:type="simple" xlink:href="Testing-View.xml"
xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase" />
</appinfo>
<element id="ims_cat" count="15" />
<element id="ims_dog" count="8" />
<element id="ims_pig" count="10" />
<element id="ims_hen" count="20" />


<!-- Testing-View.xml -->
<?xml version="1.0" encoding="utf-8"?>
<linkbase xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xlink="http://www.w3.org/1999/xlink" >
<labelLink xlink:type="extended"
xlink:role="http://www.xbrl.org/2003/role/link">

<loc xlink:type="locator" xlink:href="Testing-Element.xml#ims_cat"
xlink:label="ims_cat1_lbl" />
<label xlink:type="resource" xlink:label="ims_cat1_lbl"
color="blue">Cats are available</label>

<loc xlink:type="locator" xlink:href="Testing-Element.xml#ims_dog"
xlink:label="ims_dog1_lbl" />
<label xlink:type="resource" xlink:label="ims_dog1_lbl"
xml:lang="en" color="red">Dogs are out of stock</label>
</labelLink>
</linkbase>

Legends
<loc> element: this will link view file to element file, check
xlink:href attribute. And define the alias for element in
xlink:label="ims_cat1_lbl"
<label> element: this will link display property to alias id of
element. (ie xlink:label="ims_cat1_lbl" of <loc> must be match with
xlink:label="ims_cat1_lbl" of <label> to link them....

I am repeating my quesiton
Is it possible to Validate XML against XSD using two different XML
files. using XLink, XPointer, XPath ...or whatever u want

Thanks & Regards
Rushikesh
 
H

Henry S. Thompson

You need a pipeline which implements your semantics to produce a
merged document, then schema-validates the results.

Or you could use XInclude instead, in which case finding a tool which
does the two-step XInclude/Schema validate pipeline is more likely.

ht
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: (e-mail address removed)
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
 
R

Rushi

Hi Henry an All,

Thanks a lot to showing gr8 interest in my query. Henry i really don't
know what is this pipeline....

Your suggestion to use XInclude is fair, but i'm not allow to change
any syntax in those 2 XML files. I can create my own Schema to validate
it.

How do i do this. pls tell me briefly

thanks
Rushikesh
 
R

Rushi

Hi Henry an All,


Thanks a lot to showing gr8 interest in my query. Henry i really don't
know what is this pipeline....


Your suggestion to use XInclude is fair, but i'm not allow to change
any syntax in those 2 XML files. I can create my own Schema to validate

it.


How do i do this. pls tell me briefly....


thanks
Rushikesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top