locked
java script RRS feed

  • Question

  • how to use the java script in xslt any suggest me..........
    Tuesday, June 22, 2010 10:19 AM

Answers

  • Hi,
     
    You might want to try this:
     
    http://goog-ajaxslt.sourceforge.net/
     
    Hope this helps.
     

    -- Mike Burr
    • Marked as answer by R.Anand Tuesday, June 22, 2010 4:34 PM
    Tuesday, June 22, 2010 1:46 PM

All replies

  • Hi,
     
    You might want to try this:
     
    http://goog-ajaxslt.sourceforge.net/
     
    Hope this helps.
     

    -- Mike Burr
    • Marked as answer by R.Anand Tuesday, June 22, 2010 4:34 PM
    Tuesday, June 22, 2010 1:46 PM
  • Thanks,

    can u clear this..... here i am showing is part of xml file

    <bib id="eap002-bib-0003">
    <bookCit>
    <author><surname>Chu</surname>, <forenames>W.&#x002D;K.</forenames></author>,
    <author><surname>Mayer</surname>, <forenames>J. W.</forenames></author>,
    <author><surname>Nicolet</surname>, <forenames>M.&#x002D;A.</forenames></author>
    (<pubYear year="1978">1978</pubYear>),
    <bookTitle>Backscattering Spectrometry</bookTitle>,
    <publisherLoc>New York</publisherLoc>:
    <publisherName>Academic</publisherName>.
    </bookCit>
    </bib>

    i want the output like this using xslt

    <bib id="eap002-bib-0003">
    <bookCit>
    <bookTitle>Backscattering Spectrometry</bookTitle>
    <author id="eap002-bib-0003_au"><surname>Chu</surname>, <forenames>W.&#x002D;K.</forenames></author>,
    <author id="eap002-bib-0003_au"><surname>Mayer</surname>, <forenames>J. W.</forenames></author>,
    <author id="eap002-bib-0003_au"><surname>Nicolet</surname>, <forenames>M.&#x002D;A.</forenames></author>
    (<pubYear year="1978">1978</pubYear>),
    <publisherName>Academic</publisherName>,
    <publisherLoc>New York</publisherLoc>:.
    </bookCit>
    </bib>

     

    Tuesday, June 22, 2010 4:33 PM
  • hi,

    I am try to use msxsl:script but i got the error on namespace

    The xsl file is

    <?xml version='1.0'?>
    <xsl:stylesheet version="1.0"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          xmlns:msxsl="urn:schemas-microsoft-com:xslt"
          xmlns:user="http://mycompany.com/mynamespace">

    <msxsl:script language="JScript" implements-prefix="user">
       function xml(nodelist) {
          return nodelist.nextNode().xml;
       }
    </msxsl:script>

    <xsl:template match="/">
       <xsl:value-of select="user:xml(.)"/>
    </xsl:template>

    </xsl:stylesheet>

    and the xml file is

    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="script.xsl" ?>
    <customers>
       <customer>
          <name>John Smith</name>
          <address>123 Elm St.</address>
          <phone>(123) 456-7890</phone>
       </customer>
       <customer>
          <name>Mary Jones</name>
          <address>456 Oak Ave.</address>
          <phone>(156) 789-0123</phone>
       </customer>
    </customers>

    The error message is

    The URI http://mycompany.com/mynamespace does not identify an external Java claass
    Transformation failed: Run-time errors were reported

    can u help this problem.......

    Wednesday, June 30, 2010 11:17 AM