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

Create XML

Subject: Create XML
From: IZASKUN GUTIERREZ GUTIERREZ <igutierrez027@xxxxxxxxxxxxx>
Date: Thu, 17 Apr 2008 11:55:27 +0200
 Create XML
Hello!

I am using this stylesheet.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:owl="http://www.w3.org/2002/07/owl#" >

    <!--Esta plantilla me dice si es clase, datatypeProperty o
objectproperty-->

<xsl:output method="xml" indent="yes"/>

<xsl:param name="clase">Article</xsl:param>

<xsl:template match="rdf:RDF/rdf:Description" name="first">

        <xsl:variable name="var" select="concat('#',$clase)"/>
        <xsl:variable name="var2" select="concat('/',$clase)"/>
        <xsl:if test="ends-with(@rdf:about,$var) or
ends-with(@rdf:about,$var2)">
            <xsl:if test="
rdf:type/@rdf:resource='http://www.w3.org/2002/07/owl#Class'    ">
                <!-- guardo en el parametro this_is que es Class -->
                <xsl:call-template name="second">
                    <xsl:with-param name="this_is"  select=" 'Class'  "/>
                </xsl:call-template>
            </xsl:if>

            <xsl:if
test="rdf:type/@rdf:resource='http://www.w3.org/2002/07/owl#ObjectProperty'
or

rdf:type/@rdf:resource='http://www.w3.org/2002/07/owl#TransitiveProperty'
or

rdf:type/@rdf:resource='http://www.w3.org/2002/07/owl#FunctionalProperty'
or

rdf:type/@rdf:resource='http://www.w3.org/2002/07/owl#InverseFunctionalProper
ty'
or

rdf:type/@rdf:resource='http://www.w3.org/2002/07/owl#SymmetricProperty'
or

rdf:type/@rdf:resource='http://www.w3.org/2002/07/owl#AnnotationProperty'
">
                <!-- guardo en el parametro this_is que es ObjectProperty
-->
                <xsl:call-template name="second">
                    <xsl:with-param name="this_is"  select="
'ObjectProperty' "/>
                </xsl:call-template>
            </xsl:if>

            <xsl:if
test="rdf:type/@rdf:resource='http://www.w3.org/2002/07/owl#DatatypeProperty'
">
                <!-- guardo en el parametro this_is que es
DatatypeProperty  -->
                <xsl:call-template name="second">
                    <xsl:with-param name="this_is"  select="
'DatatypeProperty'  "/>
                </xsl:call-template>
               </xsl:if>

        </xsl:if>
    </xsl:template>

    <xsl:template name="second">
        <xsl:param name="this_is"/>
        <xsl:value-of select="$clase"/>
        <xsl:text>
        </xsl:text>
         <xsl:value-of select="$this_is"/>
    </xsl:template>
    </xsl:stylesheet>


In the "second" template depending on the value of the "this_is" param, the result is different. I have problems because i dont know how write the result. In this case like Article is Class I need write in the console

<Article id="abc">
  <author type="string">John Smith</author>
</Article>

The problem is that Article, abc, author , John Smith are params and I
dont Know how create them to write in the console because I must use
the params with
$.

Than you

Izaskun

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.