[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

What is the appropriate XPath 2.0 expression to refere

Subject: What is the appropriate XPath 2.0 expression to reference an XSD simpleType ?
From: "Costello, Roger L. costello@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 29 Dec 2015 14:08:59 -0000
 What is the appropriate XPath 2.0 expression to refere
Hi Folks,

My XSLT program needs to add a new simpleType to this schema:

<schema xmlns="http://www.w3.org/2001/XMLSchema"
               targetNamespace="T"
               xmlns:t="T">

    <simpleType name="base">
        <restriction base="string" />
    </simpleType>

</schema>

My XSLT needs to add this:

    <simpleType name="titleType">
        <restriction base="t:base">
            <maxLength value="20" />
        </restriction>
    </simpleType>

Of course, if the schema is designed like this:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
                   targetNamespace="T"
                   xmlns="T">

    <xs:simpleType name="base">
        <xs:restriction base="xs:string" />
    </xs:simpleType>

</xs:schema>

Then my XSLT needs to add this:

    <xs:simpleType name="titleType">
        <xs:restriction base="base">
            <xs:maxLength value="20" />
        </xs:restriction>
    </xs:simpleType>

And if the schema does not have a targetNamespace:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:simpleType name="base">
        <xs:restriction base="xs:string" />
    </xs:simpleType>

</xs:schema>

Then my XSLT needs to add this:

    <xs:simpleType name="titleType">
        <xs:restriction base="base">
            <xs:maxLength value="20" />
        </xs:restriction>
    </xs:simpleType>

I am struggling with the appropriate XPath 2.0 expression to reference the
base simpleType. In the first schema, referencing the base simpleType must be
expressed this way:

	t:base

In the second and third schemas, referencing the base simpleType must be
expressed this way:

	base

My XSLT has a template rule containing this:

    <xs:simpleType name="titleType">
        <xs:restriction base="_____">
            <xs:maxLength value="20" />
        </xs:restriction>
    </xs:simpleType>

What is the appropriate XPath 2.0 expression to use in _____?

/Roger

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.