Jump to content

adsingh1

Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About adsingh1

  • Rank
    Newbie
  1. hi martin thanku for reply. my xslt is requsition.xslt <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" /> <xsl:strip-space elements="*"/> <xsl:template match="*:field"> <xsl:element name="{lower-case(@name)}"> <xsl:apply-templates/> </xsl:element> </xsl:template> <xsl:template match="*:ExportXML"> <JobPositionPostings> <xsl:apply-templates/> </JobPositionPostings> </xsl:template> <xsl:template match="*:record"> <JobPositionPosting> <xsl:apply-templates select="*:field[starts-with(@name,'ContestNumber')]"/> <JobDisplayOptions> <xsl:apply-templates select="*:field[starts-with(@name,'ManagerRequisitionTitle')]"/> </JobDisplayOptions> </JobPositionPosting> </xsl:template> <xsl:template match="*:field[@name=TypeName]"/> <xsl:template match="*:field[@name=TypeName]" mode="title"> <xsl:apply-templates/> </xsl:template> </xsl:stylesheet> i tried whatever u suggested but still i am getting output like this.now that <JobPositionPostings> tag is not cming in output. is there any problem when <ExportXml > tag containg namespace .because it is not behaving like root tag.so only i think <JobPositionPostings> tag is not present in output. requisition.xml <JobPositionPosting> <contestnumber>1300000F</contestnumber> <JobDisplayOptions> <managerrequisitiontitle>Project Manager</managerrequisitiontitle> </JobDisplayOptions> </JobPositionPosting><JobPositionPosting> <contestnumber>1300000H</contestnumber> <JobDisplayOptions> <managerrequisitiontitle>Project Manager</managerrequisitiontitle> </JobDisplayOptions> </JobPositionPosting><JobPositionPosting> <contestnumber>1300000T</contestnumber> <JobDisplayOptions> <managerrequisitiontitle>Project Manager</managerrequisitiontitle> </JobDisplayOptions> </JobPositionPosting><JobPositionPosting> <contestnumber>13000018</contestnumber> <JobDisplayOptions> <managerrequisitiontitle>Project Manager</managerrequisitiontitle> </JobDisplayOptions> </JobPositionPosting><JobPositionPosting> <contestnumber>000123</contestnumber> <JobDisplayOptions> <managerrequisitiontitle>Project Manager</managerrequisitiontitle> </JobDisplayOptions> </JobPositionPosting><JobPositionPosting> <contestnumber>1300000R</contestnumber> <JobDisplayOptions> <managerrequisitiontitle>Project Manager</managerrequisitiontitle> </JobDisplayOptions> </JobPositionPosting><JobPositionPosting> <contestnumber>13000016</contestnumber> <JobDisplayOptions> <managerrequisitiontitle>Project Manager</managerrequisitiontitle> </JobDisplayOptions> </JobPositionPosting> even i tried to generate separate file for every <record> tag containing data.in that i can get data in <JobPositionPostings> . using this xslt <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output omit-xml-declaration="yes" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="*[starts-with(name(), 'record')]"> <xsl:result-document href="{$pDest}section{position()}.xml"> <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:result-document> </xsl:template> </xsl:stylesheet> but this also generating only last <record> tag detail. <JobPositionPostings> <JobPositionPosting>13000016<JobDisplayOptions>Project Manager</JobDisplayOptions> </JobPositionPosting> </JobPositionPostings> please suggest me some solution either get every record tag detail in seprate file or in one file containing <JobPositionPostings> tag.thanks in advance
  2. hi martin thanks for ur reply. my input xml message 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> <record> <field name="ContestNumber">000123</field> <field name="ManagerRequisitionTitle">Project Manager</field> </record> <record> <field name="ContestNumber">1300000R</field> <field name="ManagerRequisitionTitle">Project Manager</field> </record> <record> <field name="ContestNumber">13000016</field> <field name="ManagerRequisitionTitle">Project Manager</field> </record> </ExportXML></Content></Document></ns1:getDocumentByKeyResponse></soapenv:Body></soapenv:Envelope> my expexted output is output.xml <?xml version="1.0" encoding="UTF-8"?> <JobPositionPostings> <JobPositionPosting> <contestnumber>1300000F</contestnumber> <JobDisplayOptions> <managerrequisitiontitle>Project Manager</managerrequisitiontitle> </JobDisplayOptions> </JobPositionPosting> <JobPositionPosting> <contestnumber>1300000H</contestnumber> <JobDisplayOptions> <managerrequisitiontitle>Project Manager</managerrequisitiontitle> </JobDisplayOptions> </JobPositionPosting> <JobPositionPosting> <contestnumber>1300000T</contestnumber> <JobDisplayOptions> <managerrequisitiontitle>Project Manager</managerrequisitiontitle> </JobDisplayOptions> </JobPositionPosting> <JobPositionPosting> <contestnumber>13000018</contestnumber> <JobDisplayOptions> <managerrequisitiontitle>Project Manager</managerrequisitiontitle> </JobDisplayOptions> </JobPositionPosting> <JobPositionPosting> <contestnumber>000123</contestnumber> <JobDisplayOptions> <managerrequisitiontitle>Project Manager</managerrequisitiontitle> </JobDisplayOptions> </JobPositionPosting> <JobPositionPosting> <contestnumber>1300000R</contestnumber> <JobDisplayOptions> <managerrequisitiontitle>Project Manager</managerrequisitiontitle> </JobDisplayOptions> </JobPositionPosting> <JobPositionPosting> <contestnumber>13000016</contestnumber> <JobDisplayOptions> <managerrequisitiontitle>Project Manager</managerrequisitiontitle> </JobDisplayOptions> </JobPositionPosting> </JobPositionPostings> but i am not able to get this in my output </JobPositionPostings> tag is not coming as parent tag my xsl file is myxsl.xsl <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" /> <xsl:strip-space elements="*"/> <xsl:template match="/"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template> <xsl:template match="*:field"> <xsl:element name="{lower-case(@name)}"> <xsl:apply-templates/> </xsl:element> </xsl:template> <xsl:template match="/"> <xsl:copy> <xsl:apply-templates select="node()"/> </xsl:copy> </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> please suggest me any solution.thanku in advance
  3. 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.
  4. 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...