This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: XML schema general convert with XSLT (namespaces..)


There aren't really any facilities in XSLT 1.0/XPath 1.0 for manipulating
QNames and namespace prefixes held in attributes.

I think if you're going to do this, it probably makes sense to develop a set
of extension functions that provide the required capability, and the
implementation of these is probably going to be processor-dependent.

Mike Kay

> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of
> ronald heller
> Sent: 21 September 2001 08:33
> To: XSL-List@lists.mulberrytech.com
> Subject: [xsl] XML schema general convert with XSLT (namespaces..)
>
>
> Hi,
>
> Suppose I want to write a general convertor for XML schema,
> example:
> <xs:element name="Access-code" type="xs:string"/>
>
> sample code:
> <xsl:choose>
> 	<xsl:when test="@type='xsd:string'">
> 		<xsl:text>Text</xsl:text>
> 	</xsl:when>
> 	<xsl:otherwise>
> 		<xsl:text>UNKNOWN TYPE </xsl:text>
> 		<xsl:value-of select="@type"/>
> 	</xsl:otherwise>
> </xsl:choose>
>
> (suppose : The xsd: is equal to the xs namespace)
>
> So in the above the output is:
> <P>UNKNOWN TYPE xs:string</P>
>
> When I change the namespace prefix into xs:
> <P>Text</P>
>
> I have to know somehow in which namespace it is written,
> somehow. Is there
> anyway of telling which namespace is used?
> Sure I can give the used namespace as a paramter etc., but
> that really
> doesn't feel right.
>
> Any suggestions?
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]