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

namespaces and xsl:template match

Subject: namespaces and xsl:template match
From: "Christof Schneider" <Christof_Schneider@xxxxxx>
Date: Fri, 11 Apr 2003 22:37:02 +0200
xsl template match namespace
Dear community,

following an excerpt from an xmi-document, i want to
transform:

<?xml version = '1.0' encoding = 'UTF-8' ?>
<XMI xmi.version = '1.2' xmlns:UML =
'org.omg.xmi.namespace.UML'
  <XMI.header>
    <XMI.documentation>
    </XMI.documentation>
  </XMI.header>
  <XMI.content>
    <UML:Model xmi.id = 'a1' name = 'Canoo' isSpecification
= 'false' isRoot = 'false'
      isLeaf = 'false' isAbstract = 'false'>
	 ...

      <UML:Namespace.ownedElement>
        <UML:Class xmi.id = 'a4' name = 'Energie' visibility
= 'public' isSpecification = 'false'
          isRoot = 'false' isLeaf = 'false' isAbstract =
'false' isActive = 'false'>


       ...

and a xslt which looks like this:

<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:UML="http://org.omg/UML/1.3"
                xmlns:zoph="http://zoph">

   <xsl:output indent="no" method="xml"
encoding="iso-8859-1"/>

   <xsl:template match="XMI.header">
   	<header/>
   	<!-- ignore XMI.header section -->
   </xsl:template>

   <xsl:template match="XMI.content">
   	<content/>
   		<xsl:apply-templates/>
   </xsl:template>

   <xsl:template match="UML:Namespace.ownedElement">
   	<ownedElement/>
   	<xsl:apply-templates/>
   </xsl:template>

   <!-- xsl:template match="UML:*">
   	<test/>
   	<xsl:apply-templates/>
   </xsl:template -->

   <xsl:template match="UML:Class">
   	<zoph:element>
   		<xsl:attribute name="name"><xsl:value-of
select="./@name"/></xsl:attribute>
   	</zoph:element>
   </xsl:template>

   <xsl:template match="UML:Model">
   	<xsl:apply-templates/>
   </xsl:template>

When processing this xslt does not produce any output. When
I change the <xsl:template
match="UML:Namespace.ownedElement"> to <xsl:template
match="UML_Namespace.ownedElement"> it produces output, but
sure, not I am wanting.

How to process namespaceprefixed tags like <UML:Model>?
Where to pay attention? Is my understanding wrong to use
xsl:template match="UML:.... or "UML:*" for all?

Using ant and xalan 2 fyi.

Thanks in advance for your answer. Have a nice weekend!

- Christof


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


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.