Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > how to validate two XML against XSD?

Reply
Thread Tools

how to validate two XML against XSD?

 
 
Rushi
Guest
Posts: n/a
 
      12-07-2005
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"
xmlnssi="http://www.w3.org/2001/XMLSchema-instance"
xmlnslink="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

 
Reply With Quote
 
 
 
 
Henry S. Thompson
Guest
Posts: n/a
 
      12-07-2005
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: http://www.velocityreviews.com/forums/(E-Mail Removed)
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
 
Reply With Quote
 
 
 
 
Rushi
Guest
Posts: n/a
 
      12-08-2005
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

Henry S. Thompson wrote:
> 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 Removed)
> URL: http://www.ltg.ed.ac.uk/~ht/
> [mail really from me _always_ has this .sig -- mail without it is forged spam]


 
Reply With Quote
 
Rushi
Guest
Posts: n/a
 
      12-09-2005
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XML Schema to validate against XML encryption Stefan XML 3 03-29-2008 12:28 PM
Validate against two field. UJ ASP .Net 5 05-22-2006 05:59 PM
Validate XML against DTD and/or XML Schema? Reid Priedhorsky Python 2 04-17-2006 08:46 AM
Validate Document object against Schema without reparsing the xml veerleverbr@hotmail.com Java 2 06-28-2005 07:42 AM
tool to validate xml file against custom XML Schema file Leona XML 9 11-01-2004 09:51 AM



Advertisments