Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by sbutt

  1. Hi All, My following XSD is not getting validated. The error message that says: failed to read document etso-code-lists.xsd. <!-- edited with XMLSpy v2008 sp1 (http://www.altova.com) by Michael Conroy (TEDIOR SARL) --><!-- edited with XML Spy v4.4 (http://www.xmlspy.com) by Michael Conroy (SEMA) --><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ecl="etso-code-lists.xsd" xmlns:ecc="etso-core-cmpts.xsd" targetNamespace="etso-core-cmpts.xsd" elementFormDefault="qualified"> <xsd:import namespace="https://www.entsoe.eu/fileadmin/user_upload/edi/library/core/
  2. Hi All, I want to subtract '2 hours' from a given time in xslt 1. E.g. <xsl:variable name="time"> <xsl:choose> <xsl:when test="ns0:DepartureTime !=''"> <xsl:value-of select="ns0:DepartureTime"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="'00:00:00'"/> </xsl:otherwise> </xsl:choose> </xsl:variable> I want from this $time variable now subtract 2 hours and set it's value to an attribute. <xsl:value-of select="$time"></xsl:value-of> Could some please help?
  3. Hi all, I am kind of stuck in implementing a rather tricky output for my given xml source. My input is: <PickUpOpeningHours>08:00 - 22:00</PickUpOpeningHours> And I want an output similar to: <SubSection SubTitle="OfficeHours"><Paragraph Name="Monday"><Text>CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOCCCCCCCC</Text></Paragraph><Paragraph Name="Tuesday"><Text>CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOCCCCCCCC</Text></Paragraph><
  4. Hi All, I am kind of find it difficult to build my (xslt 1) template: I have this following XML input: <Ticket> <ItineraryItem> <Flight ArrivalDateTime="2012-08-31T09:40:00" DepartureDateTime="2012-08-31T06:00:00" DirectionInd="Outbound"> <DepartureAirport LocationCode="BRN"/> <ArrivalAirport LocationCode="ZTH"/> <OperatingAirline Code="2L" FlightNumber="5320"/> </Flight> </ItineraryItem> <ItineraryItem> <Flight ArrivalDateTime="2012-09-14T11:00:00" DepartureDateTime="2012-09-14T10:15:00" DirectionInd="In
  5. Hi Folks, I am looking for a solution as to how I can mask some data that is part of a CDATA element. My currently implemented xslt-1 script works fine when my xml element/attribute is not placed inside cdata, for example, in the following xml snippet, I masked <CreditCardNumber> element's data: Input XML: <?xml version="1.0" encoding="UTF-8"?><fareRequest da="true"><vcrs> <vcr>U2</vcr></vcrs><fareTypes/><tourOps/><flights> <flight depApt="SXF" depDate="2012-04-19" dstApt="BUD"/> <flight depApt="BUD" depDate="2012-04
  6. Hi Folks, I am using XSLT 1.0, and stuck in a situation where I am having decimal rounding problem. Let me give you an example: My generated XML is: <?xml version="1.0" encoding="UTF-8"?><CostSummary><CostingItems> <CostingItem CostBasis="7" Description="Per Person" PassengerRPH="1"> <UnitCost Amount="3.333333" CurrencyCode="EUR"/> </CostingItem> <CostingItem CostBasis="7" Description="Per Person" PassengerRPH="2"> <UnitCost Amount="3.333333" CurrencyCode="EUR"/> </CostingItem> <CostingItem CostBasis="7" Descriptio
  7. thanks i got the problem solved. i needed a template to output the variables value inside xsl:comment. Thanks anyway!
  8. I am trying to get xsl comments on my XMLSpy XSLT output console, but the comment is not appearing. My xslt script is: <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:ota="http://www.opentravel.org/OTA/2003/05" exclude-result-prefixes="ota xsl"> <xsl:output encoding="UTF-8" version="2.0" method="xml"/> <xsl:strip-space elements="*"/> <xsl:variable name="no_of_adult_persons" select="count(//ota:PassengerListItems/ota:PassengerListItem[@Code = '10']
  9. sbutt

    Handling Cdata

    I figured that out already but thanks dude appreciated!
  10. Hi All, I have a following xml: <?xml version="1.0" encoding="UTF-8"?><ForwardRequestResponse xmlns:m="http://webservices.kuoni.ch"> <ForwardRequestResult><![CDATA[<?xml version="1.0" encoding="windows-1252"?><Response Version="2.5" From="KUONEKA0" To="CETS" TermId="XXXXXX" Date="18062009" Time="163523" Type="ERROR" Confirm="X" Agent="XXXXXX" Lang="EN" UserCode="X" UserType="X" UserName="X" UserFirstName="X" Mode="X"><Err><ErrorNr>9999</ErrorNr><ErrorText>Fehlerhafter Request</ErrorText><ErrorText>element <Request&
  11. sbutt

    Handling Cdata

    Hi Boen, Now I'm finding it difficult to resolve problem no 2.I'm using the following xsl script: <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:exslt="http://exslt.org/common" xmlns:datetime="http://exslt.org/dates-and-times" xmlns:func="http://exslt.org/functions" xmlns:function="http://function.com" xmlns:dyn="http://exslt.org/dynamic" xmlns:java="java" exclude-result-prefixes="xsl soap"> <xsl:output encoding="UTF-8" version="1.0" meth
  12. sbutt

    Handling Cdata

    I was checking some examples about cdata-section-elements attribute and found some solution.I modified my script to and now it produces my intended results: ...<ForwardRequest xmlns="http://webservices.kuoni.ch"> <request><xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text> <xsl:apply-templates select="Request"/><xsl:text disable-output-escaping="yes">]]</xsl:text><xsl:text disable-output-escaping="yes">></xsl:text> <!-- CDATA would contain Request element and all its decendents -->
  13. sbutt

    Handling Cdata

    Hi Boen, Thanks for your reply, Regardign question 1), I have tried according to what you said but it didn't work. Here is my example xsl script: <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsl:strip-space elements="soap:*"/> <xsl:output method="xml" version="1.0" encoding="ISO-8859-1" cdata-section-elements="request"/> <xsl:templ
  14. Hi Folks, I have two questions:1). How to escape CDATA in your xslt script? <xsl:template match="/"> <![CDATA[ <xsl:apply-templates select="node()"/> ]]> </xsl:template> In the above code, the template inside CDATA does not get executed. What I actually want is the result from this template (<xsl:apply-templates select="node()"/>) to be returned as CDATA. For example, if the apply template returns.... <request code=10 type="2"/> then i want the final output to be <![CDATA[<request code=10 type="2"/>]]> . But at th
  15. Thanks Dude - much appreciated!for 9101112..the element's data would always be a sequence stating from 1<Persons>123456789101112</Persons>
  16. I have build the following example: <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:str="http://exslt.org/strings"> <xsl:template match="/"> <xsl:apply-templates select="Persons"/> </xsl:template> <xsl:template match="Persons"> <PassengerRPHs> <xsl:attribute name="ListOfPassengerRPH"> <xsl:for-each select="str:tokenize(Persons, '.')" xml:space="preserve"> <xsl:value-of select="."/> <xsl:if test="po
  17. Well i got the error: Function tokenize is not found.This is what my transformator is: \xalan-j_2_7_0\xalan.bat on Altova XMLSpy.The specs from xalan 2.7.0 says the following:An input document can be either XML 1.0 or XML 1.1. Also, a stylesheet document can be either XML 1.0 or XML 1.1. A stylesheet document must conform to the XSLT 1.0 specifications.Thanks.
  18. Thanks for your reply, but actually I was talking about an "XSLT script" to handle the above problem :)Transforming this <Persons>12</Persons> to <PassengerRPHs ListOfPassengerRPH="1 2"/> Any help?
  19. In Java: javax.xml.transform.OS: Linux/Win32
  20. Thanks your reply, but could you please give me a small code snippet or pointer on how to handle the problem in hand using either of the possibilities?
  21. Hi Folks, I'm new to xslt transofrmation so need a little help in transforming the following example.Input: <Persons>12</Persons> Output: <PassengerRPHs ListOfPassengerRPH="1 2"/> The main thing above is to put a space between digits, 123 -> 1 2 3.It would be perfect if the transformation also handles 9101112 -> 9 10 11 12In typical java programming, i know i can tokenize it using some RE and put a space in between and concatenate, but i'm not sure how to do the same in XSLT:(Any help would be much appreciated.
  • Create New...