RE: [xsl] convert xml with schema to html with xslt

Subject: RE: [xsl] convert xml with schema to html with xslt
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 21 Dec 2009 10:35:36 -0000
> I have a problem. I have a small xml file which has a schema 
> declaration in the root element. I cannot convert it to html 
> with an xslt file. 

How did it fail?

> If i remove the schema declaration the conversion is fine.
> Please suggest me how to correct this. 

Are you using Altova's XSLT processor by any chance? This appears to use the
presence of xsi:schemaLocation as a signal to perform schema validation.
When I last looked, I couldn't find any way of overriding this behaviour.

> I have included a shcema import but it didnt help:
> <xsl:import-schema namespace="urn:Verlag" 
> schema-location="urn:Verlag 
>"; />

How did it fail when you added the xsl:import-schema?

<xsl:template name="paragraph" match="para">

In your source XML document, para is in a namespace so this rule won't match
anything. That's true regardless whether you validate against the schema or
not. But perhaps when you tried without the xsi:schemaLocation, you removed
the default namespace declaration as well? In which case this is just the
standard old elephant trap of matching elements in the default namespace,
and nothing to do with schemas at all.


Michael Kay 

Current Thread