Jump to content

[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
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...