XSLT and Schema
Posted: Tue Feb 10, 2009 5:26 pm
I've ordered some books and I've been googling like crazy but it seems there's a disconnect between XSLT and the schema of the XML file I'm transforming. I can't figure out how to determine the node type and I also need to pull all the possible elements for the header list.
George already helped me get a list from the xml itself (thank you!) but since some elements are optional that won't always give me a complete list. I realize I could fill in those records to do this but since we're not the source of the xml it would be better if I could pull it from the schema.
So, I'm wondering if there's a way to take advantage of the xsd of the xml file I'm transforming. Specifically, can someone point me to solutions to the following?:
George already helped me get a list from the xml itself (thank you!) but since some elements are optional that won't always give me a complete list. I realize I could fill in those records to do this but since we're not the source of the xml it would be better if I could pull it from the schema.
So, I'm wondering if there's a way to take advantage of the xsd of the xml file I'm transforming. Specifically, can someone point me to solutions to the following?:
- A way to determine the xsd-defined type of a node (xs:int, xs:string, xs:decimal, etc.)
- A way to pull the element names from the xsd. Specifically, if minOccurs="0" I can't just pull them from the XML reliably as they may not be used in a particular "record"
- I've seen mention of some extensions (like MSXML) that may or may not still be around? Is there a good set of extensions/templates/functions I should be looking at to make life easier? Something tied to the transformer even? I see that there's entry points for them in Oxygen. FWIW, we're a Windows-based shop that mostly does Java development, and that's eventually where I'll be heading with this. Maybe that's relevant.