Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Specifying an XSL file in a schema

Status
Not open for further replies.

prgmrgirl

Programmer
Feb 12, 2004
119
US
Howdy everyone,

I have a schema and I would like all documents that conform to that schema to be transformed a certain way. Would I be able to specify the xsl file to use right on the schema? The xml file names may change etc but I want anything that conforms to this schema to be transformed the same way.

Is there any way to do this?

Thanks!
prgmrgirl
 
>I have a schema and I would like all documents that conform to that schema to be transformed a certain way. Would I be able to specify the xsl file to use right on the schema?

To make xsl stylesheet and xsd schema document jointly appearing together in one place, the standardizing body has provisioned a way, namely, in the xml document. Concretely, it is the processing instruction
[tt] <?xml-stylesheet type="text/xsl" href="[blue]the_url[/blue]" ?>[/tt]
and
[tt] xsi:schemaLocation[/tt]
[tt]or xsi:noNamespaceSchemaLocation[/tt]

But they both can be overriden by any application and they are designed to be so making the provision suggestive without enforcing necessarily the joint use.

Why does it work at all? It is _only_ because the standard-aware utility try to accommodate with the provision with the built-in engine. Notable examples are those common browsers such as ie, moz/ff/nn and op.

But the two pieces of information are all appearing in any validating application and those appeared in the application have the final say, ie, they will override what appeared in the xml document. The application here I mean any concrete code or script with the purpose of reading and parsing and validating xml documents.

With all the above, I mean to say that you can supply that piece of information (ie, the specific xsl document) sure in the xsd such as in an annotation or any other specific place so that the application can locate it and read it (because the coder/scripter tell it to do so). The final say rests in the application. And that appears to be a round-trip to the essential said in the previous paragraph. Hope this make the consideration of the issue more figurative with contrast.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top