Jump to content

Search the Community

Showing results for tags 'xslt transformation'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 2 results

  1. hi all, i m very new to xslt. i need a help.i want add a root tag in my xml using xslt where xml file returning more than one rows. my xslt is demo.xsl <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template> <xsl:template match="/*:ExportXML"> <sources> <xsl:for-each-group select="*:record" group-by="*:field[@name=ContestNumber]"> <sourcetype> <sourcelist> </sourcelist> </sourcetype> </xsl:for-each-group> </sources> </xsl:template> <xsl:template match="*:field"> <xsl:element name="{lower-case(@name)}"> <xsl:apply-templates/> </xsl:element> </xsl:template> <xsl:template match="*:record"> <JobPositionPostings> <JobPositionPosting> <xsl:apply-templates select="*:field[starts-with(@name,'ContestNumber')]"/> <JobDisplayOptions> <xsl:apply-templates select="*:field[starts-with(@name,'ManagerRequisitionTitle')]"/> </JobDisplayOptions> </JobPositionPosting> </JobPositionPostings> </xsl:template> <xsl:template match="*:field[@name=TypeName]"/> <xsl:template match="*:field[@name=TypeName]" mode="title"> <xsl:apply-templates/> </xsl:template> </xsl:stylesheet> my output is cming like this requisition.xml <?xml version="1.0" encoding="UTF-8"?><JobPositionPostings> <JobPositionPosting> <jobpositionpostingid>1300000F</jobpositionpostingid> <HiringOrg> <Industry> <summarytext>Project Manager</summarytext> </Industry> <Contact> <PersonName/> </Contact> </HiringOrg> <JobDisplayOptions/> <JobPositionInformation> <JobClassifications> <PrimaryJobCategory/> </JobClassifications> <JobPositionDescription/> <JobPositionLocation/> <CompensationDescription> <Pay/> </CompensationDescription> <JobPositionRequirements> <JobExperience/> <JobQualifications/> </JobPositionRequirements> </JobPositionInformation> <HowToApply> <ApplicationMethods> <ByEmail/> <ByWeb/> </ApplicationMethods> </HowToApply> </JobPositionPosting></JobPositionPostings><JobPositionPostings> <JobPositionPosting> <jobpositionpostingid>1300000H</jobpositionpostingid> <HiringOrg> <Industry> <summarytext>Project Manager</summarytext> </Industry> <Contact> <PersonName/> </Contact> </HiringOrg> <JobDisplayOptions/> <JobPositionInformation> <JobClassifications> <PrimaryJobCategory/> </JobClassifications> <JobPositionDescription/> <JobPositionLocation/> <CompensationDescription> <Pay/> </CompensationDescription> <JobPositionRequirements> <JobExperience/> <JobQualifications/> </JobPositionRequirements> </JobPositionInformation> <HowToApply> <ApplicationMethods> <ByEmail/> <ByWeb/> </ApplicationMethods> </HowToApply> </JobPositionPosting></JobPositionPostings><JobPositionPostings> <JobPositionPosting> <jobpositionpostingid>1300000T</jobpositionpostingid> <HiringOrg> <Industry> <summarytext>Project Manager</summarytext> </Industry> <Contact> <PersonName/> </Contact> </HiringOrg> <JobDisplayOptions/> <JobPositionInformation> <JobClassifications> <PrimaryJobCategory/> </JobClassifications> <JobPositionDescription/> <JobPositionLocation/> <CompensationDescription> <Pay/> </CompensationDescription> <JobPositionRequirements> <JobExperience/> <JobQualifications/> </JobPositionRequirements> </JobPositionInformation> <HowToApply> <ApplicationMethods> <ByEmail/> <ByWeb/> </ApplicationMethods> </HowToApply> </JobPositionPosting></JobPositionPostings> i want that Root tag <JobPositionPostings> just as root tag(open and close one time) but its repeating for every row please suggest me any solution for this.thanks in advance.
  2. hi everbody, i m very new to xsl.my requirement is transform a flat xml to nested xml using xsl transform for that i have to pass xml template file which contain xsl file path ,name and record placeholder.i dont knw how my template file ll be. my input xml file is input.xml <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:getDocumentByKeyResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://www.taleo.com/ws/integration/toolkit/2005/07"><Document xmlns="http://www.taleo.com/ws/integration/toolkit/2005/07"><Attributes><Attribute name="duration">0:00:00.130</Attribute><Attribute name="count">7</Attribute><Attribute name="entity">Requisition</Attribute><Attribute name="mode">XML</Attribute><Attribute name="version">http://www.taleo.com/ws/tee800/2009/01</Attribute></Attributes><Content> <ExportXML xmlns="http://www.taleo.com/ws/integration/toolkit/2005/07"> <record> <field name="ContestNumber">1300000F</field> <field name="ManagerRequisitionTitle">Project Manager</field> </record> <record> <field name="ContestNumber">1300000H</field> <field name="ManagerRequisitionTitle">Project Manager</field> </record> <record> <field name="ContestNumber">1300000T</field> <field name="ManagerRequisitionTitle">Project Manager</field> </record> <record> <field name="ContestNumber">13000018</field> <field name="ManagerRequisitionTitle">Project Manager</field> </record> </ExportXML></Content></Document></ns1:getDocumentByKeyResponse></soapenv:Body></soapenv:Envelope> my xslt file is <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:itk="http://www.taleo.com/ws/integration/toolkit/2005/07"> <xsl:output method="text" encoding="UTF-8"/> <xsl:template match="itk:record"> <xsl:text>JOB INFORMTION</xsl:text> <xsl:value-of select="itk:field[@name=ContestNumber]"/> <xsl:text>|</xsl:text> <xsl:value-of select="itk:field[@name=ManagerRequisitionTitle]"/> <xsl:text disable-output-escaping="yes"> </xsl:text> <xsl:text>====</xsl:text> <xsl:text disable-output-escaping="yes"> </xsl:text> </xsl:template> </xsl:stylesheet> my expected output xml is output.xml <?xml version="1.0" encoding="UTF-8" ?> <JobPositionPostings><JobPositionPosting><JobPositionPostingID>1300000F</JobPositionPostingID> <Industry><jobPost>Project Manager</jobPost> </Industry></JobPositionPosting></JobPositionPostings> for xml input template file i dont have more idea about record place holder .please suggest me how it ll look like. i created like this <?xml version="1.0" encoding="UTF-8" ?> <?xml-stylesheet type="text/xsl" href="mycustom.xsl"?> after that how to place xsl fetch value in this i dont know.
×
×
  • Create New...