|
Subject: [xsl] generating xml with a runtime resolved default namespace From: Jerome.Euzenat@xxxxxxxxxxxx (Jerome Euzenat) Date: Tue, 7 Jan 2003 18:38:31 +0100 |
I submit to this enlightened list a concrete XSLT problem for a change.
It comes from the need to have a variable default namespace in the output docu-
ment. That is a default namespace which is known at run-time only.
I reduce the problem below to a small stylesheet and input and output
documents:--------- tentative stylesheet <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns = "http://www.w3.org/2003/OWL-XMLSchema" xmlns:rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:owls= "http://www.w3.org/2003/OWL-XMLSchema">
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template> <xsl:template match="owls:Ontology">
<rdf:RDF
xmlns="{$prefix}#"
xmlns:rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<xsl:apply-templates mode="axioms"/>
</rdf:RDF>
</xsl:template>------------- input <?xml version="1.0" encoding="UTF-8"?>
<owls:Ontology xmlns:owls= "http://www.w3.org/2003/OWL-XMLSchema"> <owls:Individual owls:name="foo" owls:class="Bar" /> </owls:Ontology>
------------- output <?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns="http://www.example.com#" xmlns:rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <Bar rdf:resource="#foo" /> </rdf:RDF>
--
Jérôme Euzenat __
/ /\
INRIA Rhône-Alpes, _/ _ _ _ _ _
/_) | ` / ) | \ \ /_)
655, avenue de l'Europe, (___/___(_/_/ / /_(_________________
Montbonnot St Martin, / http://www.inrialpes.fr/exmo
38334 Saint-Ismier cedex, / Jerome.Euzenat@xxxxxxxxxxxx
France____________________/ Jerome.Euzenat@xxxxxxx| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] Number of times apply-tem, Wendell Piez | Thread | Re: [xsl] generating xml with a run, G. Ken Holman |
| RE: [xsl] Number of times apply-tem, Corey Snow | Date | [xsl] Translet Stability Issue, Jeff Harman |
| Month |