davegreig1978 0 Newbie Poster

Hello all,

I am quite new with XML and XSLT, have been making good progress with tutorials and forums. I am transforming a XML file into HTML but I cannot figure out how to transform the pieces that make up my mixed complexType. I have searched and searched and come up with nothing. I am sure it is blindingly obvious but i just can not get it.

Here is my xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="service_catalogue">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="catalogue_name" type="xs:string"/>
                <xs:element name="catalogue_description" type="content"/>
                <xs:element name="service_area" minOccurs="1" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="area_name" type="xs:string"/>
                            <xs:element name="area_description" type="content"/>
                            <xs:element name="service_category" minOccurs="1" maxOccurs="unbounded">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="category_name" type="xs:string"/>
                                        <xs:element name="category_description" type="content"/>
                                        <xs:element name="service" minOccurs="1" maxOccurs="unbounded">
                                            <xs:complexType>
                                                <xs:sequence>
                                                    <xs:element name="service_name" type="xs:string"/>
                                                    <xs:element name="service_description" type="content"/>
                                                    <xs:element name="availability" type="content"/>
                                                    <xs:element name="service_target" type="content"/>
                                                    <xs:element name="service_constraints" type="content"/>
                                                    <xs:element name="customer_responsibilities" type="content"/>
                                                    <xs:element name="service_access" type="content"/>
                                                    <xs:element name="service_owner" type="xs:string"/>
                                                    <xs:element name="service_client" type="xs:string"/>
                                                    <xs:element name="service_output" type="xs:string"/>
                                                    <xs:element name="service_type" type="xs:string"/>
                                                    <xs:element name="service_int_ext" type="xs:string" />
                                                </xs:sequence>
                                            </xs:complexType>
                                        </xs:element>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
   
    <xs:complexType name="content">
        <xs:choice maxOccurs="unbounded" minOccurs="0">
            <xs:element name="para" type="para_content"/>           
       </xs:choice>
    </xs:complexType>
   
    <xs:complexType name="para_content" mixed="true">
        <xs:choice maxOccurs="unbounded" minOccurs="0">
            <xs:element name="unordered_list" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="ulist_item" type="xs:string" maxOccurs="unbounded"></xs:element>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="glossary_link" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
           
        </xs:choice>
    </xs:complexType>
   
</xs:schema>

Here is a relevant chunk of my xml:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="AG_Layout.xsl"?>
<service_catalogue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="AG_ServiceCat_Content.xsd">

   
    <catalogue_name>ITSD - Service Catalogue</catalogue_name>
    <catalogue_description>
        <para>The ITSD Service Catalogue has been developed to define customer services. The service definitions focus on providing customers with a clear statement of what is available, what customers need to do to get the service, and ITSD’s service target.</para>
        <para>On the left portion of the screen, you will find links to ITSD services, which have been organized under general service categories. On the right, there are links to supporting materials and quick access to ITSD Service Desk.</para>
    </catalogue_description>
   
    <service_area>
        <area_name>Core Services</area_name>
        <area_description><para>Core Services Description goes here</para></area_description>
       
        <service_category>
            <category_name>Service Requests</category_name>
            <category_description><para>This service facilitates requests and tracks the approval process for services requested by ITSD customers.</para></category_description>
           
            <service>
                <service_name>Set Up New Employee</service_name>
                <service_description><para>Sets up all IT related services for new employees including access to the government network, government standard software and hardware, Ministry supported applications and other IT related services.</para></service_description>
                <availability><para>This service is available to ITSD customers during <glossary_link>Standard Business Hours</glossary_link></para></availability>
                <service_target><para>To Be Determined</para></service_target>
                <service_constraints><para><glossary_link>Standard Service Constraints</glossary_link></para></service_constraints>
                <customer_responsibilities><para><glossary_link>Standard Customer Responsibilities</glossary_link> Customers will be required to fill in all required fields in the "New Hire Form". Customers are expected to provide additional information (if required) to ITSD in a timely fashion.</para></customer_responsibilities>
                <service_access><para>To obtain this service simply click on the Service Request button below, or, contact your Service Manager at 250 555-1212</para></service_access>
                <service_owner/>
                <service_client></service_client>
                <service_output></service_output>
                <service_type>Transactional</service_type>
                <service_int_ext>Both</service_int_ext>
            </service>
</service_category>
    </service_area>
</service_catalogue>

And finaly here is the relevant chunk of my xsl:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
 <xsl:output method="html"/>
   
   <xsl:template match="/">
        <html>
            <head>
                <META http-equiv="Expires" content="0"/>
                <meta http-equiv="Cache-Control" content="no-cache"/>
                <meta http-equiv="Pragma" content="no-cache"/>
                <script type="text/javascript" language="JavaScript" src="general.js"></script>
                <link rel="stylesheet" type="text/css" href="style-gov.css"></link>
                    <link rel="stylesheet" type="text/css" href="stylesheets/stylenn4.css"></link>
               
            </head>
            <body >
                <h2><xsl:value-of select="service_catalogue/catalogue_name"/></h2>
                <p><xsl:value-of select="service_catalogue/catalogue_description"/></p>
               
                <xsl:for-each select="service_catalogue/service_area">
                    <table>
                        <tr>
                            <td><b>Service Area:</b></td>
                            <td><xsl:value-of select="area_name"/></td>
                        </tr>
                        <tr>
                            <td><b>Service Area Description:</b></td>
                            <td><xsl:value-of select="area_description"/></td>
                        </tr>                       
                    </table>
                    <br/>
                    <table border="1">
                        <xsl:for-each select="service_category">
                            <xsl:variable name="serv_cat_name" select="category_name"/>
                            <tr bgcolor="#9acd32">
                                <th align="left">Service Category</th>
                                <th align="left"><a name="{$serv_cat_name}"></a>Service Category Description</th>
                            </tr>
                            <tr>
                                <td><b><xsl:value-of select="category_name"/></b></td>
                                <td>
                                   
                                <xsl:value-of select="category_description"/>
                              
                                    </td>
                            </tr>
</table>
                     </xsl:for-each>
               
            </body>
        </html>
    </xsl:template>

In the xsl <xsl:value-of select="category_description"/> is the spot where I need to transform the complexType. What I want to do is to turn all of the <glossary_link> into <a href=""> Any help here would be greatly appreciated.

Dave