[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Re: Does XSLT support schema validation

Subject: Re: Re: Does XSLT support schema validation
From: santony@xxxxxxxxxxxxx
Date: Thu, 20 Nov 2003 22:29:18 -0500
santony
Thanks a real lot Mike:
Thanks a lot for the detailed reply John:

After looking around enough, I think this is the best solution.

1. Parse the input XML as a DOM tree, using a validating parser.
2. Read or change the values as needed at this stage, on the resulting DOM tree.
3. Do the XSLT transformation and get the result as a DOM tree.
4. Read or change the values as needed at this stage, on the output DOM tree.
5. Serialize the tree into XML

Now my only concern is efficiency.

Another technique that occured to me is using JAXB..
1. Compile the input and output schemas into java object trees using JAXB.
2. Unmarshal the input XML to form the input side object tree.
3. Once input object tree is formed, change/read the values as required
4. Manually copy ( this step is equivalent to XSLT ) the values from the input tree to form the output object tree.
5. Marshal the output tree to output XML.

Can anybody share their thoughts on this solution.

Thanks again
--sony









> 
> From: Mike Rawlins <mcr@xxxxxxxxxxxxxxxxxxxxxxx>
> Date: 2003/11/20 Thu PM 08:36:03 EST
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  Does XSLT support schema validation
> 
> At 08:16 PM 11/20/2003 -0500, you wrote:
> >1. I have a java application that will be using XSLT, through the Java JAXP
> >classes.
> >We would like to make sure that both the input and output XMLs are in
> >aggreement to 2 respective schemas. Is it possible to do this using XSLT.
> >If possible are there any JAXP interfaces for this mechanism.
> 
> No, you don't do this using XSLT.  You do it on the source document before 
> it is processed by XSLT, and on the result document after.  You can use 
> JAXP, but how you use it will depend on the rest of your code.
> 
> 
> >2. While doing the above conversion, we would like to extract some
> >values from the input XML to a Java string variable. Similarly we would 
> >like to
> >insert some values contained within the Java variables to the produced
> >XML. Is this possible at all.
> 
> Yes, certainly.  However, this again sounds like a JAXP issue that is 
> independent of XSLT.  You can use DOM, SAX, or whatever to retrieve values 
> from the source document and insert values into the result document.
> 
> 
> 
> ---------------------------------------------------------------
> Michael C. Rawlins, Rawlins EC Consulting
> www.rawlinsecconsulting.com
> Using XML with Legacy Business Applications (Addison-Wesley, 2003)
> www.awprofessional.com/titles/0321154940
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.