tags:

views:

29

answers:

2

Hi,

I have generated an XSD file for an XML file and it's working when I am exporting data from Excel.

I would like to know if it's possible to specify the XSL file in the Schema itself, so that when the XML file is created, the XSL is already assigned to it.

Is that even possible? Or do I have to do it through Excel VBA code (which I really don't want)?

Thanks in advance,

Yusuf

A: 

That sounds strange. The point is that you may have different XSL transforms for each schema, to create different outputs from the same XML.

Albin Sunnanbo
yeah it may sound strange, but for this particular Excel file, I'd like to already specify the `XSL` transform automatically when exporting, and I will have only one transform.
Yusuf
+1  A: 

If by "assign" an XSLT stylesheet you mean adding a PI to the XML document, then the answer would be that you have to do it with VBA code (or any second step tool, as XSLT itself). I don't see this option when exporting an Excel to XML.

Alejandro
meaning that I cannot, for example, insert a line in the `XSD` file which would add that PI automatically?
Yusuf
@Yusuf: XML Schema doesn't target serialization (meaning document as a whole, with DOCTYPE, PI, etc.) but element by element content schema. So, there is no way to reference a PI outside root element.
Alejandro
ok then, thanks for your help.. i'll have to do it through VBA :(
Yusuf