Jump to content
Sign in to follow this  

[solved]Load xslt file in XML file

Recommended Posts

Hi guys, I have a xml file and I append a new contact in my XML file from XUL.When i append a new contact I want to generate a ID to my new customer contact in my xml file using XSLT.Is it possible to load my XSLT file through my xml file and save it? Please give me a suggestion guys!!! Thank you.My xml file:

<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="idgenerator.xsl"?><CONTACTS><CONTACT><Customer-ID>N65539</Customer-ID><FirstName>Ben</FirstName><LastName>Foden</LastName><email></email><address></address><state>AZ</state><country>US</country></CONTACT><CONTACT><Customer-ID>N65539</Customer-ID><FirstName>Nimal</FirstName><LastName>Anup</LastName><email>nimal.anup@gmail.com</email><address></address><state>TN</state><country>IN</country></CONTACT><CONTACTS>

My XSLT file:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">    <xsl:output method="xml" indent="yes"/>    <xsl:strip-space elements="*"/>    <xsl:template match="node()|@*">        <xsl:copy>            <xsl:apply-templates select="node()|@*"/>        </xsl:copy>    </xsl:template>    <xsl:template match="CONTACT">        <xsl:copy>               <PDE-Identity>               <xsl:value-of select="generate-id(.)"/>                </PDE-Identity>        </xsl:copy>    </xsl:template></xsl:stylesheet>

Edited by karthikin

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...