Jump to content

sbutt

Members
  • Content Count

    22
  • Joined

  • Last visited

Community Reputation

0 Neutral

About sbutt

  • Rank
    Newbie
  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
×
×
  • Create New...