xsl-list
[Top] [All Lists]

RE: How to generate <schema> element

2005-05-13 08:23:45
Your code looks fine to me. Perhaps you should post a complete (simplified)
stylesheet and we can see if other processors give the same problem.

Michael Kay
http://www.saxonica.com/

 

-----Original Message-----
From: Michael(_dot_)Giroux(_at_)Bull(_dot_)com 
[mailto:Michael(_dot_)Giroux(_at_)Bull(_dot_)com] 
Sent: 13 May 2005 15:30
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] How to generate <schema> element 





I have a tool that parses a non-java program source and emits an XML
document containing a description of the public data types.  
The XML is
then used with XSL to generate program documentation, Java 
data mappers to
the non-java program data types, etc.

I'm attempting to generate WSDL <types> and <message> 
elements for use in
web service descriptions.  My template is nearly complete but 
I have one
final problem.  I'm not able to get the schema generated with 
the proper
namespace.

XSL snippet follows:
<?xml version="1.0"?>
<xsl:stylesheet version = '1.0'
  xmlns="http://schemas.xmlsoap.org/wsdl/";
  xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
  xmlns:tns="urn:bpel:jiap"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema";
  xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/";
  xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/";
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
  xmlns:xalan="http://xml.apache.org/xslt";

<xsl:output method="xml" indent="yes" xalan:indent-amount="2"/>

<xsl:template match="component">
    <definitions targetNamespace="urn:bpel:jiap">
      <xsl:element name="types">
         <xsl:element name="schema" namespace="
http://www.w3.org/2001/XMLSchema";>
            <xsl:attribute name="targetNamespace">urn:bpel:jiap
</xsl:attribute>
            <xsl:apply-templates select="cobolrecord"/>
         </xsl:element>  <!--  </schema> -->
      </xsl:element> <!-- </types> -->
      <!-- code removed -->
    </definitions>
</xsl:template>
...


The generated code does not have the correct namespace for 
the generated
schema element and as a result, none of the types are found 
when WSDL2JAVA
processes the outer WSDL which includes these type declarations.

The namespace for the <schema> element is coming from the containing
<definitions> element, and not from the namespace attribute of the
<element> instruction.

Can someone tell me the correct way to define the xsl so that 
I get the
desired generation?

Thanks
Michael Giroux

Example of generated code follows:
<?xml version="1.0" encoding="UTF-8"?>
<definitions
  xmlns="http://schemas.xmlsoap.org/wsdl/";
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
  xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/";
  xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/";
  xmlns:xsd="http://www.w3.org/2001/XMLSchema";
  xmlns:tns="urn:bpel:jiap"
  targetNamespace="urn:bpel:jiap"

  <types>
    <schema xmlns="http://schemas.xmlsoap.org/wsdl/"; targetNamespace=
"urn:bpel:jiap">


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>