Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Xsi:type attribute
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Divers
Thread ID:
00877031
Message ID:
00877222
Vues:
16
Hi Alexander,

If you want to define these namespace prefixes on uyour XSLT document, all you need to do is to use the element/atttribute qualified name and declare the namespace at the "xsl:stylesheet" element. Please, take a look at the code below:
LOCAL loXML    as MSXML2.DOMDocument
LOCAL loXSL    as MSXML2.DOMDocument
LOCAL lcXML    as String 
LOCAL lcXSL    as String
LOCAL lcResult as String 

TEXT TO lcXML TEXTMERGE NOSHOW PRETEXT 1+2+4
  <?xml version="1.0"?>
  <Parent> 
    <Children> 
      <Child id="1">Child 1</Child>
      <Child id="2">Child 2</Child>
    </Children> 
  </Parent> 
ENDTEXT 

TEXT TO lcXSL TEXTMERGE NOSHOW PRETEXT 1+2+4
  <?xml version="1.0"?>
  <xsl:stylesheet version = "1.0"
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  
    <xsl:template match="/">
      <NewChildren>
        <xsl:apply-templates />
      </NewChildren>
    </xsl:template>

    <xsl:template match="Child">
      <Child>
        <xsl:attribute name="xsi:id">
          <xsl:value-of select="@id" />
        </xsl:attribute>
      </Child>
    </xsl:template>
  
  </xsl:stylesheet>
ENDTEXT 

loXML = CREATEOBJECT("MSXML2.DOMDocument")
loXSL = CREATEOBJECT("MSXML2.DOMDocument")

loXML.LoadXML(lcXML)
loXSL.loadXML(lcXSL)

lcResult = loXML.transformNode(loXSL)

MESSAGEBOX(lcResult)

loXML = null
loXSL = null
HTH.
-----
Fabio Vazquez
http://www.fabiovazquez.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform