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
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