|
I would also consider XQuery, I find it easier and if you a
tool like Stylus Studio you can do the mapping graphically. If you have Saxon
installed as part of Xmlbeans you can do it on the fly (same as you can with
XSL).
Regards
Don From: Lu, Shengkai [mailto:[EMAIL PROTECTED] Sent: 24 June 2005 18:20 To: '[email protected]' Subject: RE: auto generate xsl based on 2 different xml schema files? If I only have
one target schema, I could use java. In my case, there might be multiple target
schemas. It would be more convenient for me to translate the source xml files to
target xml files if I could get the xsl generated automatically out off the
schema files. I guess the worst scenario is that I have to write xsl files from
the scratch based off the schema files. Steve
Lu From: Steven
Traut [mailto:[EMAIL PROTECTED] Steve, This kind of conversion is the sort
of thing that XSL is often used for, so that's certainly an option. Seems to me
the kind of tool you're describing would need to provide a UI through which you
can "map" aspects of one XML shape (schema) to the other. I don't know of such a
tool, although I know that XMLSpy offers an XSL design
environment. Since you have schema for both XML
shapes, there's a non-XSL option that that involves Java and XMLBeans. You could
compile both of your schemas using scomp, then write Java code that copies
values from an instance of one schema into a new instance of the other schema.
So if schema A has a Foo element of type xs:string, and schema B has a Bar
element of type xs:string (with parent Baz), you could do something like
this:
newBaz.setBar(incomingFoo.getStringValue()); I think you'd need to convert
non-string values to strings where necessary. You could also use XPath to get
values from the incoming schema (which is what XSL does
anyway). I don't know how efficient this is,
and it feels like a wacky use of schema, but it's an idea for someone unfamiliar
with XSL, but comfortable with Java. Steve
|
Title: auto generate xsl based on 2 different xml schema files?
- auto generate xsl based on 2 different xml schema files? Lu, Shengkai
- RE: auto generate xsl based on 2 different xml schema fi... Steven Traut
- RE: auto generate xsl based on 2 different xml schema fi... Lu, Shengkai
- RE: auto generate xsl based on 2 different xml schema fi... Mike Carey
- Don Stewart

