Jump to content

sbutt

Members
  • Content count

    22
  • Joined

  • Last visited

Community Reputation

0 Neutral

About sbutt

  • Rank
    Newbie
  1. XSD Validation Error

    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/etso-code-lists" schemaLocation="etso-code-lists.xsd"/> <!-- _________________________________________________ --> <!-- ETSO CORE COMPONENTS V22 R0 --> <!-- _________________________________________________ --> <xsd:annotation> <xsd:documentation> <Titre> List of ETSO Core Components which are used in the development of ETSO XML Messages </Titre> <Version>Current Version: 22</Version> <Release>Current Release: 0</Release> <LastCoreComponent>ET0050</LastCoreComponent> </xsd:documentation> </xsd:annotation> <!-- _________________________________________________ --> <xsd:complexType name="AreaType"> <xsd:annotation> <xsd:documentation> <Uid>ET0009</Uid> <Definition> A domain covering a number of related objects, such as balance area, grid area, etc. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:maxLength value="18"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> <xsd:attribute name="codingScheme" type="ecl:CodingSchemeType" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="AmountType"> <xsd:annotation> <xsd:documentation> <Uid>ET0022</Uid> <Definition>The monetary value of an object</Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:decimal"> <xsd:totalDigits value="17"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="CodeType"> <xsd:annotation> <xsd:documentation> <Uid>ET0023</Uid> <Definition>the coded representation of an object.</Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:maxLength value="3"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="ComponentNameType"> <xsd:annotation> <xsd:documentation> <Uid>ET0046</Uid> <Definition> The identification of an attribute for a given Component. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:maxLength value="70"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="ComponentValueType"> <xsd:annotation> <xsd:documentation> <Uid>ET0047</Uid> <Definition>The value of a given component.</Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:maxLength value="150"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> <xsd:attribute name="codingScheme" type="ecl:CodingSchemeType" use="optional"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="DateType"> <xsd:annotation> <xsd:documentation> <Uid>ET0035</Uid> <Definition> The gregorian date that must be expressed as: YYYY-MM-DD </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="xsd:date" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="IdentificationType"> <xsd:annotation> <xsd:documentation> <Uid>ET0001</Uid> <Definition> A code to uniquely distinguish one occurrence of an entity from another </Definition> . </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:maxLength value="35"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="LineType"> <xsd:annotation> <xsd:documentation> <Uid>ET0050</Uid> <Definition> the identification of a line that may be physical or virtual. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:maxLength value="35"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> <xsd:attribute name="codingScheme" type="ecl:CodingSchemeType" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="LongIdentificationType"> <xsd:annotation> <xsd:documentation> <Uid>ET0043</Uid> <Definition> A code to uniquely distinguish one occurrence of an entity from another with a long identifier </Definition> . </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:maxLength value="150"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="MessageDateTimeType"> <xsd:annotation> <xsd:documentation> <Uid>ET0006</Uid> <Definition> (Synonym "Document Date Time") Date and time of the preparation of a document. The time must be expressed in UTC as: YYYY-MM-DDTHH:MM:SSZ </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="xsd:dateTime" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="DateTimeType"> <xsd:annotation> <xsd:documentation> <Uid>ET0044</Uid> <Definition> Date and time of a given time point. The time must be expressed in UTC as: YYYY-MM-DDTHH:MM:SSZ </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="xsd:dateTime" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="MeteringPointType"> <xsd:annotation> <xsd:documentation> <Uid>ET0027</Uid> <Definition> A domain covering a number of related objects, such as metering point and accounting point, etc. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:maxLength value="35"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> <xsd:attribute name="codingScheme" type="ecl:CodingSchemeType" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="PartyType"> <xsd:annotation> <xsd:documentation> <Uid>ET0014</Uid> <Definition> The identification of an actor in the Energy market. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:maxLength value="16"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> <xsd:attribute name="codingScheme" type="ecl:CodingSchemeType" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="PositionType"> <xsd:annotation> <xsd:documentation> <Uid>ET0021</Uid> <Definition> (Synonym "pos") A sequential value representing the relative position of an entity within a space such as a time interval </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:integer"> <xsd:minInclusive value="1"/> <xsd:maxInclusive value="999999"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="QuantityType"> <xsd:annotation> <xsd:documentation> <Uid>ET0012</Uid> <Definition> (Synonym "qty") The quantity of an energy product. Positive quantities shall not have a sign. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="xsd:decimal" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="ReasonTextType"> <xsd:annotation> <xsd:documentation> <Uid>ET0016</Uid> <Definition>The textual explanation of an act.</Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:maxLength value="512"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="ResolutionType"> <xsd:annotation> <xsd:documentation> <Uid>ET0019</Uid> <Definition> Defines the number of units of time that compose an individual step within a period. The resolution is expressed in compliance with ISO 8601 in the following format:PnYnMnDTnHnMnS.Where nY expresses a number of years, nM a number of months, nD a number of days.The letter "T" separates the date expression from the time expression and after it nH identifies a number of hours, nM a number of minutes and nS a number of seconds. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="xsd:duration" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="ResourceObjectType"> <xsd:annotation> <xsd:documentation> <Uid>ET0034</Uid> <Definition> The identification of a resource object in the Energy market. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:maxLength value="18"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> <xsd:attribute name="codingScheme" type="ecl:CodingSchemeType" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:simpleType name="SubValueType"> <xsd:annotation> <xsd:documentation> <Uid>ET0036</Uid> <Definition> The partial identification of an object, which associated with another value provides the complete identification. </Definition> </xsd:documentation> </xsd:annotation> <xsd:restriction base="xsd:string"> <xsd:maxLength value="35"/> </xsd:restriction> </xsd:simpleType> <!-- _________________________________________________ --> <xsd:complexType name="TextType"> <xsd:annotation> <xsd:documentation> <Uid>ET0032</Uid> <Definition>A textual string</Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:maxLength value="700"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="TimeType"> <xsd:annotation> <xsd:documentation> <Uid>ET0033</Uid> <Definition> The time within a 24 hour day that must be expressed as: HH:MM:SS </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="xsd:time" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="TimeIntervalType"> <xsd:annotation> <xsd:documentation> <Uid>ET0007</Uid> <Definition> The start date and time and the end date and time of an event. The time interval must be expressed in a form respecting ISO 8601 : YYYY-MM-DDTHH:MMZ/YYYY-MM-DDTHH:MMZ.ISO 8601 rules for reduction may apply. The time must always be expressed in UTC. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" use="required"> <xsd:annotation> <xsd:documentation> ISO 8601 time intervals are always expressed in the form yyyy-mm-ddThh:mmZ/yyyy-mm-ddThh:mmZ Note: The minimum XML form of dateTime is yyyy-mm-ddThh:mm:ssZ </xsd:documentation> </xsd:annotation> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:pattern value="(((((20[0-9]{2})[-](0[13578]|1[02])[-](0[1-9]|[12][0-9]|3[01])|([0-9]{4})[-]((0[469])|(11))[-](0[1-9]|[12][0-9]|30))T(([01][0-9]|2[0-3]):[0-5][0-9])Z/)|(([13579][26][02468][048]|[13579][01345789](0)[48]|[13579][01345789][2468][048]|[02468][048][02468][048]|[02468][1235679](0)[48]|[02468][1235679][2468][048]|[0-9][0-9][13579][26])[-](02)[-](0[1-9]|1[0-9]|2[0-9])T(([01][0-9]|2[0-3]):[0-5][0-9])Z/)|(([13579][26][02468][1235679]|[13579][01345789](0)[01235679]|[13579][01345789][2468][1235679]|[02468][048][02468][1235679]|[02468][1235679](0)[01235679]|[02468][1235679][2468][1235679]|[0-9][0-9][13579][01345789])[-](02)[-](0[1-9]|1[0-9]|2[0-8])T(([01][0-9]|2[0-3]):[0-5][0-9])Z/))(((([0-9]{4})-(0[13578]|1[02])[-](0[1-9]|[12][0-9]|3[01])|([0-9]{4})[-]((0[469])|(11))[-](0[1-9]|[12][0-9]|30))T(([01][0-9]|2[0-3]):[0-5][0-9])Z)|(([13579][26][02468][048]|[13579][01345789](0)[48]|[13579][01345789][2468][048]|[02468][048][02468][048]|[02468][1235679](0)[48]|[02468][1235679][2468][048]|[0-9][0-9][13579][26])[-](02)[-](0[1-9]|1[0-9]|2[0-9])T(([01][0-9]|2[0-3]):[0-5][0-9])Z)|(([13579][26][02468][1235679]|[13579][01345789](0)[01235679]|[13579][01345789][2468][1235679]|[02468][048][02468][1235679]|[02468][1235679](0)[01235679]|[02468][1235679][2468][1235679]|[0-9][0-9][13579][01345789])[-](02)[-](0[1-9]|1[0-9]|2[0-8])T(([01][0-9]|2[0-3]):[0-5][0-9])Z)))"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="VersionType"> <xsd:annotation> <xsd:documentation> <Uid>ET0002</Uid> <Definition> A code that distinguishes one evolution of an identified object from another. Information about a specific object may be sent several times, each transmission being identified by a different version number. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:integer"> <xsd:minInclusive value="1"/> <xsd:maxInclusive value="999"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:complexType> <!-- _________________________________________________ --> <!-- ETSO CODE LIST TYPES --> <!-- _________________________________________________ --> <xsd:complexType name="AllocationModeType"> <xsd:annotation> <xsd:documentation> <Uid>ET0040</Uid> <Definition> Identification of the method of allocation in an auction. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:AllocationModeTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="AssetType"> <xsd:annotation> <xsd:documentation> <Uid>ET0031</Uid> <Definition>Identification of the type of asset</Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:AssetTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="AuctionType"> <xsd:annotation> <xsd:documentation> <Uid>ET0030</Uid> <Definition> The coded representation of different types of auction. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:AuctionTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="BusinessType"> <xsd:annotation> <xsd:documentation> <Uid>ET0017</Uid> <Definition> The exact business nature identifying the principal characteristic of a time series. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:BusinessTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="CategoryType"> <xsd:annotation> <xsd:documentation> <Uid>ET0037</Uid> <Definition>The product category of an auction.</Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:CategoryTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="ClassificationType"> <xsd:annotation> <xsd:documentation> <Uid>ET0013</Uid> <Definition> Indicates the classification mechanism used to group a set of objects together. The grouping may be of a detailed or a summary nature </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:ClassificationTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="ContractType"> <xsd:annotation> <xsd:documentation> <Uid>ET0010</Uid> <Definition> The contract type defines the conditions under which the capacity is allocated and handled. EG: daily auction, weekly auction, monthly auction, yearly auction, etc. The significance of this type is dependent on area specific coded working methods </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:ContractTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="CurrencyType"> <xsd:annotation> <xsd:documentation> <Uid>ET0024</Uid> <Definition> The coded identification of legal tender using ISO 4217 3 alpha codes </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:CurrencyTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="CurveType"> <xsd:annotation> <xsd:documentation> <Uid>ET0042</Uid> <Definition> The type of curve being defined in the time series. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:CurveTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="DirectionType"> <xsd:annotation> <xsd:documentation> <Uid>ET0026</Uid> <Definition> The coded identification of the direction of energy flow. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:DirectionTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="DocumentType"> <xsd:annotation> <xsd:documentation> <Uid>ET0045</Uid> <Definition> (Synonym "Message Type") The coded type of a document. The document type describes the principal characteristic of a document </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:MessageTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="EicType"> <xsd:annotation> <xsd:documentation> <Uid>ET0028</Uid> <Definition> The coded identification of the type of an EIC code. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:EicTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="EnergyProductType"> <xsd:annotation> <xsd:documentation> <Uid>ET0008</Uid> <Definition> The identification of the nature of an energy product such as Power, energy, reactive power, etc. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:EnergyProductTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="IndicatorType"> <xsd:annotation> <xsd:documentation> <Uid>ET0029</Uid> <Definition> A boolean indicator to express Yes or No or True or False </Definition> . </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:IndicatorTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="MessageType"> <xsd:annotation> <xsd:documentation> <Uid>ET0003</Uid> <Definition> (Synonym "Document Type") The coded type of a document. The document type describes the principal characteristic of a document. note this code is decrecated and should no longer be used in new messages (use documentType instead)) </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:MessageTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="ObjectAggregationType"> <xsd:annotation> <xsd:documentation> <Uid>ET0018</Uid> <Definition> The identification of the domain that is the common dominator used to aggregate a time series. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:ObjectAggregationTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="PaymentTermsType"> <xsd:annotation> <xsd:documentation> <Uid>ET0041</Uid> <Definition> The terms which dictate the determination of the bid payment price. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:PaymentTermsTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="PriceCategory"> <xsd:annotation> <xsd:documentation> <Uid>ET0048</Uid> <Definition> The category of a price to be used in a price calculation. Note: the price category is mutually agreed between System Operators </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:PriceCategoryTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="PriceDirection"> <xsd:annotation> <xsd:documentation> <Uid>ET0049</Uid> <Definition> The nature of a price (i.e.an Impacted Area System Operator pays to internal Market Parties or inverse). </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:PriceDirectionTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="ProcessType"> <xsd:annotation> <xsd:documentation> <Uid>ET0020</Uid> <Definition> Indicates the nature of process that the document addresses. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:ProcessTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="QualityType"> <xsd:annotation> <xsd:documentation> <Uid>ET0036</Uid> <Definition>The quality of an object.</Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:QualityTypeList" use="required"/> </xsd:complexType> <!-- _________________________________________________ --> <xsd:complexType name="ReasonCodeType"> <xsd:annotation> <xsd:documentation> <Uid>ET0015</Uid> <Definition>The coded motivation of an act.</Definition> > </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:ReasonCodeTypeList" use="required"/></xsd:complexType><!-- _________________________________________________ --><xsd:complexType name="RightsType"> <xsd:annotation> <xsd:documentation> <Uid>ET0038</Uid> <Definition> The rights of use that is accorded to what is acquired in an auction.. </Definition> > </xsd:documentation></xsd:annotation><xsd:attribute name="v" type="ecl:RightsTypeList" use="required"/></xsd:complexType><!-- _________________________________________________ --><xsd:complexType name="RoleType"> <xsd:annotation> <xsd:documentation> <Uid>ET0005</Uid> <Definition>Identification of the role played by a party.</Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:RoleTypeList" use="required"/></xsd:complexType><!-- _________________________________________________ --><xsd:complexType name="TarifTypeType"> <xsd:annotation> <xsd:documentation> <Uid>ET0039</Uid> <Definition> The standard tarif types as defined in the UCTE policies. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:TarifTypeTypeList" use="required"/></xsd:complexType><!-- _________________________________________________ --><xsd:complexType name="StatusType"> <xsd:annotation> <xsd:documentation> <Uid>ET0025</Uid> <Definition> The condition or position of an object with regard to its standing. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:StatusTypeList" use="required"/></xsd:complexType><!-- _________________________________________________ --><xsd:complexType name="UnitOfMeasureType"> <xsd:annotation> <xsd:documentation> <Uid>ET0011</Uid> <Definition> (synonym MeasurementUnit) The unit of measure that is applied to a quantity. The measurement units shall be in compliance with UN/ECE Recommendation 20. </Definition> </xsd:documentation> </xsd:annotation> <xsd:attribute name="v" type="ecl:UnitOfMeasureTypeList" use="required"/></xsd:complexType><!-- ___________________________________________________________ --><!-- ___________________________________________________________ --></xsd:schema> But if I open in browser etso-code-lists.xsd, i can see the imported xsd. Please note, the "etso-code-lists.xsd" is not located on my local machine, but at the namespace and schemaLocation referenced, i.e. "https://www.entsoe.eu/fileadmin/user_upload/edi/library/core/etso-code-lists.xsd" I am not sure how to reference the file locally. It should work with a url reference as well? I am using a free online XSD validator tool "www.utilities-online.info/xsdvalidation/#.VNjOzvnF_eU" Could someone please help?
  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. xslt 1 transformation help

    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><Paragraph Name="Wednesday"><Text>CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOCCCCCCCC</Text></Paragraph><Paragraph Name="Thursday"><Text>CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOCCCCCCCC</Text></Paragraph><Paragraph Name="Friday"><Text>CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOCCCCCCCC</Text></Paragraph><Paragraph Name="Saturday"><Text>CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOCCCCCCCC</Text></Paragraph><Paragraph Name="Sunday"><Text>CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOCCCCCCCC</Text></Paragraph></SubSection> Let me explain the output logic. C: closesO: opened Time is represented in 24 hours. 1 hour = 4 x 15 min (4 quarters)24 hours = 96 x 15 min (96 quarters) Total characters (C or O) will be 96 in total, where each character represents single quarter of time. The input xml could be of two different formats: <PickUpOpeningHours>07:00 - 23:00</PickUpOpeningHours> OR <PickUpOpeningHours>08:30 - 12:00, 14:30 - 18:00</PickUpOpeningHours> Can someone please help me out in devising some solution for the above problem using xslt 1? Thanks.
  4. XSLT apply template help

    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="Inbound"> <DepartureAirport LocationCode="ZTH"/> <ArrivalAirport LocationCode="CFU"/> <OperatingAirline Code="2L" FlightNumber="5321"/> </Flight> </ItineraryItem> <ItineraryItem> <Flight ArrivalDateTime="2012-09-14T12:40:00" DepartureDateTime="2012-09-14T11:40:00" DirectionInd="Inbound"> <DepartureAirport LocationCode="CFU"/> <ArrivalAirport LocationCode="BRN"/> <OperatingAirline Code="2L" FlightNumber="5321"/> </Flight> </ItineraryItem> </Ticket> And Have built the following template (xslt 1): <xsl:template match="ota:Flight"><xsl:variable name="direction" select="@DirectionInd"/><Fat ServiceType="T"><xsl:attribute name="SegRef"><xsl:if test="java:setIndex($rph_pos, java:getIndex($rph_pos) + 1)"/><xsl:value-of select="format-number(java:getIndex($rph_pos) - 1,'000.#')"/></xsl:attribute><xsl:if test="../@Key"><xsl:attribute name="Key"><xsl:choose><xsl:when test="ota:CabinAvailability/ota:Seat/@Code"><xsl:variable name="code" select="ota:CabinAvailability/ota:Seat/@Code"/><xsl:value-of select="concat(substring(../@Key, 1, 10), $code, substring(../@Key, 12))"/></xsl:when><xsl:otherwise><xsl:value-of select="../@Key"/></xsl:otherwise></xsl:choose></xsl:attribute></xsl:if><StartDate><xsl:value-of select="datetime:format-date(substring(@DepartureDateTime, 1, 10), 'ddMMyyyy')"/></StartDate><Dep><xsl:value-of select="ota:DepartureAirport/@LocationCode"/></Dep><Arr><xsl:value-of select="ota:ArrivalAirport/@LocationCode"/></Arr><Persons><xsl:value-of select="translate(ota:CabinAvailability/ota:PassengerRPHs/@ListOfPassengerRPH,' ', '')"/></Persons></Fat> And it generates the following output: <Request><Fat ServiceType="T" SegRef="000"><StartDate>31082012</StartDate><Dep>BRN</Dep><Arr>ZTH</Arr><Persons>12</Persons></Fat><Fat ServiceType="T" SegRef="001"><StartDate>14092012</StartDate><Dep>ZTH</Dep><Arr>CFU</Arr><Persons>12</Persons></Fat><Fat ServiceType="T" SegRef="002"><StartDate>14092012</StartDate><Dep>CFU</Dep><Arr>BRN</Arr><Persons>12</Persons></Fat></Request> Whereas I want an output to be like this: <Request><Fat ServiceType="T" SegRef="000"><StartDate>31082012</StartDate><Dep>BRN</Dep><Arr>ZTH</Arr><Persons>12</Persons></Fat><Fat ServiceType="T" SegRef="001"><StartDate>14092012</StartDate><Dep>ZTH</Dep><Arr>BRN</Arr><Persons>12</Persons></Fat></Request> That is to skip the intermediate flight, but only the start and end airports. In this above case, The outbound flight is fine, but there are 2 Inbound flights. I just want the starting Inbound airport and the final Inbound airport in the return flight. Similarly, there could be a scenario, where I have 2 Outbound flight, in that case the scenario woulc be the same that is the first Outboud flight and last Outboud flight. Normal scenario with single Outbound and Inbound flight are only covered at the moment by my template above. That case should stay as it is in the revised template. Your help in this regard should be highlly appreciated. Thanks.
  5. Masking data inside CData

    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-25" dstApt="SXF"/></flights><CreditCardNumber>123456123</CreditCardNumber><limit>20</limit><offset>0</offset><waitOnList> <waitOn>ALL</waitOn></waitOnList><coses/></fareRequest> XSLT-1 Script: <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.2" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ota="http://www.opentravel.org/OTA/2003/05" xmlns:anyway="http://anyway.com/webservices/" xmlns:k="http://webservices.kuoni.ch" xmlns:xft="http://www.exchangefortravel.org/xft/current" xmlns:tu="http://tempuri.org/" xmlns:jet2="http://Jet2.Com/External/2009/01/V4"><xsl:output encoding="UTF-8" version="1.0" method="xml" indent="yes" cdata-section-elements="anyway:request k:request k:ForwardRequestResult xft:NameText xft:Description xft:URL xft:From xft:To xft:Code tu:XRq tu:ProcessTransactionXFTUResult libelle nom prenom adresse1 ville pays email"/><xsl:strip-space elements="*"/><!--add coma separated element names without namespace prefix to be masked, dont remove first coma! --><xsl:param name="names">!,Number,CCV,cc_number,cc_cvv,AccountNumber,CardSecurityCode,card_number,options,CreditCardNumber,CardNumber,IssueNumber,SecurityCode,</xsl:param><xsl:template match="/"> <xsl:apply-templates select="node()"/></xsl:template><xsl:template match="@*"> <xsl:variable name="attr-name" select="concat(',' , local-name() , ',')"/> <xsl:attribute name="{name()}" namespace="{namespace-uri()}"> <xsl:choose> <xsl:when test="string-length(substring-before($names, $attr-name)) > 0"> <xsl:call-template name="mask"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="."/> </xsl:otherwise> </xsl:choose> </xsl:attribute></xsl:template><xsl:template match="text()"> <xsl:copy/></xsl:template><xsl:template match="*"> <xsl:variable name="el-name" select="concat(',' , local-name(), ',')"/> <xsl:choose> <xsl:when test="string-length(substring-before($names, $el-name)) > 0"> <xsl:element name="{name()}" namespace="{namespace-uri()}"> <xsl:call-template name="mask"/> </xsl:element> <xsl:apply-templates select="@*"/> <xsl:apply-templates select="*"/> </xsl:when> <xsl:otherwise> <xsl:element name="{name()}" namespace="{namespace-uri()}"> <xsl:apply-templates select="@*"/> <xsl:apply-templates/> </xsl:element> </xsl:otherwise> </xsl:choose></xsl:template><xsl:template name="index-of"> <xsl:param name="param1"/> <xsl:param name="param2"/> <xsl:value-of select="string-length(substring-before(concat(' ' ,$param1), $param2))"/></xsl:template><xsl:template name="mask"> <xsl:variable name="length" select="string-length(.)"/> <xsl:choose> <xsl:when test="$length > 3"> <xsl:value-of select="concat ('************', substring(.,$length - 1, 2))"/> </xsl:when> <xsl:when test="$length > 1">***</xsl:when> <xsl:otherwise/> </xsl:choose></xsl:template></xsl:stylesheet> Output 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-25" dstApt="SXF"/></flights><CreditCardNumber>************23</CreditCardNumber><limit>20</limit><offset>0</offset><waitOnList> <waitOn>ALL</waitOn></waitOnList><coses/></fareRequest> In the above example <CreditCardNumber>************23</CreditCardNumber> is masked properly. But when in my XML, I have the following scenario: <?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-25" dstApt="SXF"/></flights><![CDATA[<CreditCardNumber>123456123</CreditCardNumber>]]><limit>20</limit><offset>0</offset><waitOnList> <waitOn>ALL</waitOn></waitOnList><coses/></fareRequest> That is <CreditCardNumber> inside CDATA, the script does not mask the data. Or in other words, everything that is contained inside CDATA, is ignored because it is not considered as an element or attribute by the xslt processor. Could somebody help me out in fixing this problem? Please note that my script is in XSLT 1. Thanks.
  6. Decimal Rounding Problem

    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" Description="Per Person" PassengerRPH="2"> <UnitCost Amount="3.333333" CurrencyCode="EUR"/> </CostingItem></CostingItems><GrossAmount Amount="10.00" CurrencyCode="EUR"/></CostSummary> My requirement is that the GrossAmount (10), should always be equal to the sum of all the UnitCost Amounts. In the above xml, each UnitCost Amount is generated by GrossAmount/No. of CostingItem >> 10/3= 3.33333. Hence in order to resolve this problem, I have decided to roundup the values to 2 decimal places and adjust the difference in the last CostingItem's UnitCost. For example: <?xml version="1.0" encoding="UTF-8"?><CostSummary><CostingItems> <CostingItem CostBasis="7" Description="Per Person" PassengerRPH="1"> <UnitCost Amount="3.34" CurrencyCode="EUR"/> </CostingItem> <CostingItem CostBasis="7" Description="Per Person" PassengerRPH="2"> <UnitCost Amount="3.34" CurrencyCode="EUR"/> </CostingItem> <CostingItem CostBasis="7" Description="Per Person" PassengerRPH="2"> <UnitCost Amount="3.32" CurrencyCode="EUR"/> </CostingItem></CostingItems><GrossAmount Amount="10.00" CurrencyCode="EUR"/></CostSummary> So could someone please help me out in creating the xslt script for the above scenario? I am currently using xslt 1.0. Thanks.
  7. xsl comment not appearing

    thanks i got the problem solved. i needed a template to output the variables value inside xsl:comment. Thanks anyway!
  8. xsl comment not appearing

    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'])"/> <xsl:variable name="adult_persons_prices"> <xsl:call-template name="adult"> <xsl:with-param name="nodelist_adult" select="//ota:PassengerListItems/ota:PassengerListItem[@Code = '10']"/> <xsl:with-param name="nodelist" select="//ota:CostingItem"/> </xsl:call-template> </xsl:variable> <xsl:template name="adult"> <xsl:param name="nodelist_adult"/> <xsl:param name="nodelist"/> <xsl:param name="counter">1</xsl:param> <xsl:param name="sum">0.00</xsl:param> <xsl:variable name="rph" select="$nodelist_adult[$counter]/@RPH"/> <xsl:comment> <xsl:value-of select="count($nodelist_adult)"/> </xsl:comment> <xsl:comment> <xsl:value-of select="count($nodelist)"/> </xsl:comment> <xsl:comment> <xsl:value-of select="$counter"/> </xsl:comment> <xsl:comment> <xsl:value-of select="$sum"/> </xsl:comment> <xsl:comment> <xsl:value-of select="$nodelist_adult[$counter]/@RPH"/> </xsl:comment> <xsl:comment>=============================</xsl:comment> <xsl:variable name="sum_temp"> <xsl:value-of select="$sum + $nodelist[$counter]/ota:UnitCost/@Amount"/> </xsl:variable> <xsl:choose> <xsl:when test="$counter < count($nodelist_adult)"> <xsl:call-template name="adult"> <xsl:with-param name="nodelist_adult" select="$nodelist_adult"/> <xsl:with-param name="nodelist" select="$nodelist"/> <xsl:with-param name="counter" select="$counter + 1"/> <xsl:with-param name="sum" select="$sum_temp"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$sum_temp"/> </xsl:otherwise> </xsl:choose> </xsl:template></xsl:stylesheet> and xml input <?xml version="1.0" encoding="UTF-8"?><OTA_TT_PkgBookRS Version="1.0" xmlns="http://www.opentravel.org/OTA/2003/05"> <Success/> <PackageReservation> <UniqueID ID="7305042" Type="14"/> <Package BrandCode="OHG" ProductCode="201842820" Status="Confirmed"> <DateRange End="2011-05-10" Start="2011-04-26"/> <ItineraryItems> <ItineraryItem RPH="1" Status="Confirmed"> <Accommodation> <Identity HotelCode="201842820" HotelName="Broncemar"/> <DateRange Duration="P14D" End="2011-05-10" Start="2011-04-26"/> <RoomProfiles> <RoomProfile BookingCode="201842820" RoomTypeCode="1011907"> <GuestCounts IsPerRoom="true"> <GuestCount AgeQualifyingCode="10" Count="2"/> </GuestCounts> <PassengerRPHs ListOfPassengerRPH="1 2"/> </RoomProfile> </RoomProfiles> <MealPlans> <MealPlan Code="BB" MealType="B & B"> <CustomerCounts> <CustomerCount Code="10" Quantity="2"/> </CustomerCounts> <PassengerRPHs ListOfPassengerRPH="1 2"/> </MealPlan> </MealPlans> </Accommodation> </ItineraryItem> </ItineraryItems> </Package> <ContactDetail> <PersonName> <NamePrefix>Mr</NamePrefix> <GivenName>Mark</GivenName> <Surname>Dost</Surname> </PersonName> <Telephone PhoneNumber="02349711464"/> <Address> <StreetNmbr>Unistr.90</StreetNmbr> <CityName>Bochum</CityName> <PostalCode>44789</PostalCode> <CountryName Code="DE">Deutschland</CountryName> </Address> <Email>mark.dost@iff.traveltainment.de</Email> </ContactDetail> <PassengerListItems> <PassengerListItem BirthDate="1986-01-12" Code="10" Gender="Male" RPH="1"> <Name> <NamePrefix>Mr</NamePrefix> <GivenName>Mark</GivenName> <Surname>Dost</Surname> </Name> </PassengerListItem> <PassengerListItem BirthDate="1987-01-12" Code="10" Gender="Female" RPH="2"> <Name> <NamePrefix>Mrs</NamePrefix> <GivenName>Claudia</GivenName> <Surname>Ollmann</Surname> </Name> </PassengerListItem> </PassengerListItems> <InvoiceDetail> <CostingItems> <CostingItem CostBasis="7" PassengerRPH="1"> <UnitCost Amount="398.01" CurrencyCode="EUR"/> </CostingItem> <CostingItem CostBasis="7" PassengerRPH="2"> <UnitCost Amount="57.5000" CurrencyCode="EUR"/> </CostingItem> </CostingItems> <GrossAmount Amount="455.51" CurrencyCode="EUR"/> </InvoiceDetail> </PackageReservation></OTA_TT_PkgBookRS> Could someone please help me out?I am using xslt 1.0 xalan processor in my xmlspy
  9. Handling Cdata

    I figured that out already but thanks dude appreciated!
  10. Extracting Cdata From Xml

    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> attribute: TermId is too long</ErrorText></Err></Response>]]></ForwardRequestResult></ForwardRequestResponse> And I want to extract a CDATA out of it i.e. <?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> attribute: TermId is too long</ErrorText> </Err></Response> Could someone please give me some pointers on how to do it?
  11. 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" method="xml"/> <xsl:strip-space elements="soap:*"/> <xsl:template match="/"> <xsl:apply-templates select="soap:Envelope/soap:Body/ForwardRequestResponse"/> </xsl:template> <xsl:template match="ForwardRequestResponse"> <xsl:element name="{local-name()}" namespace="http://webservices.xx.xx"> <xsl:value-of select="ForwardRequestResult" disable-output-escaping="yes"/> </xsl:element> </xsl:template></xsl:stylesheet> On the following input: <?xml version="1.0" encoding="utf-8"?><soap:Envelope 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"> <soap:Body> <ForwardRequestResponse xmlns="http://webservices.xx.xx"> <ForwardRequestResult><?xml version="1.0" encoding="Windows-1252"?><Response Type="ERROR" SubType="WS" Version="2.5" From="KUEKA0" To="EBOOKERS" TermId="" Window="A" Date="18062009" Time="1341" Confirm="YES" Agent="" Lang="DE" UserCode="123456" UserType="M" UserName="EBOOKERS" UserFirstName="CH"><Err><ErrorNr>9000</ErrorNr><ErrorText>Some error description </ErrorText></Err></Response></ForwardRequestResult> </ForwardRequestResponse> </soap:Body></soap:Envelope> Above is the response from the WS, though some error but it does not matter, the main thing i need is the response xml in a correct format and not with ><?? etc symbols.I tried to resolve this through your mentioned technique..disable-output-escaping="yes"/> but i'm getting transformation error, and annoyingly it has no proper description.Pls help.
  12. 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 --> </request> </ForwardRequest>... Thanks for the pointer anyway - really appreciated!
  13. 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:template match="/"> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <xsl:attribute name="xmlns:xsi">http://www.w3.org/2001/XMLSchema-instance</xsl:attribute> <xsl:attribute name="xmlns:xsd">http://www.w3.org/2001/XMLSchema</xsl:attribute> <soap:Header> <authentication xmlns="http://webservices.xx.xx"> <userid>xxx</userid> <password>xxx</password> </authentication> </soap:Header> <soap:Body> <ForwardRequest xmlns="http://webservices.xx.xx"> <request> <!-- CDATA would contain Request element and all its decendents --> <xsl:apply-templates select="Request"/> </request> </ForwardRequest> <!--xsl:copy-of select="node()"></xsl:copy-of--> </soap:Body> </soap:Envelope> </xsl:template> <xsl:template match="Request"> <xsl:element name="{local-name()}" namespace="http://webservices.xx.xx"> <xsl:copy-of select="@*"/> <xsl:copy-of select="*"/> </xsl:element> </xsl:template></xsl:stylesheet> The above script on this following input: <?xml version="1.0" encoding="ISO-8859-1"?><Request SubType="CHECK" Type="BOOK" Version="2.5" From="EBOOKERS" To="KUEKA0" TermId="1245322042390" Window="A" Date="18062009" Time="124722" Confirm="YES" Agent="" Lang="DE" UserCode="123456" UserType="M" UserName="EBOOKERS" UserFirstName="CH" Mode="Test"> <Fab Key="K0000 00"> <TOCode>KUON</TOCode> <Catalog>NEFB</Catalog> <Creator>CTS</Creator> <Fat ServiceType="T" SegRef="0"> <StartDate>03092009</StartDate> <Dep>PAR</Dep> <Arr>RAK</Arr> <Carrier>TO</Carrier> <FlightNr/> <Persons>12</Persons> </Fat> <Fat ServiceType="T" SegRef="1"> <StartDate>10092009</StartDate> <Dep>RAK</Dep> <Arr>PAR</Arr> <Carrier>TO</Carrier> <FlightNr/> <Persons>12</Persons> </Fat> <Fah ServiceType="H" SegRef="2"> <StartDate>03092009</StartDate> <Duration>7</Duration> <Destination>RAK</Destination> <Product>57346V</Product> <Room>1M</Room> <Meal>AI</Meal> <Persons>12</Persons> </Fah> <Fap ID="1"> <PersonType>M</PersonType> <Name>AAAA</Name> </Fap> <Fap ID="2"> <PersonType>C</PersonType> <Name>AAAA</Name> </Fap> </Fab></Request> Produced the following output: <?xml version="1.0" encoding="ISO-8859-1"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soap:Header> <authentication xmlns="http://webservices.kuoni.ch"> <userid>xxx</userid> <password>xxx</password> </authentication> </soap:Header> <soap:Body> <ForwardRequest xmlns="http://webservices.xx.xx"> <request> <Request SubType="CHECK" Type="BOOK" Version="2.5" From="EBOOKERS" To="KUEKA0" TermId="1245322042390" Window="A" Date="18062009" Time="124722" Confirm="YES" Agent="" Lang="DE" UserCode="123456" UserType="M" UserName="EBOOKERS" UserFirstName="CH" Mode="Test"> <Fab Key="K0000 00"> <TOCode>KUON</TOCode> <Catalog>NEFB</Catalog> <Creator>CTS</Creator> <Fat ServiceType="T" SegRef="0"> <StartDate>03092009</StartDate> <Dep>PAR</Dep> <Arr>RAK</Arr> <Carrier>TO</Carrier> <FlightNr/> <Persons>12</Persons> </Fat> <Fat ServiceType="T" SegRef="1"> <StartDate>10092009</StartDate> <Dep>RAK</Dep> <Arr>PAR</Arr> <Carrier>TO</Carrier> <FlightNr/> <Persons>12</Persons> </Fat> <Fah ServiceType="H" SegRef="2"> <StartDate>03092009</StartDate> <Duration>7</Duration> <Destination>RAK</Destination> <Product>57346V</Product> <Room>1M</Room> <Meal>AI</Meal> <Persons>12</Persons> </Fah> <Fap ID="1"> <PersonType>M</PersonType> <Name>AAAA</Name> </Fap> <Fap ID="2"> <PersonType>C</PersonType> <Name>AAAA</Name> </Fap> </Fab> </Request> </request> </ForwardRequest> </soap:Body></soap:Envelope> Whereas what I actually want is the following: <?xml version="1.0" encoding="ISO-8859-1"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soap:Header> <authentication xmlns="http://webservices.kuoni.ch"> <userid>xxx</userid> <password>xxx</password> </authentication> </soap:Header> <soap:Body> <ForwardRequest xmlns="http://webservices.xx.xx"> <request> <![CDATA[<Request SubType="CHECK" Type="BOOK" Version="2.5" From="EBOOKERS" To="KUEKA0" TermId="1245322042390" Window="A" Date="18062009" Time="124722" Confirm="YES" Agent="" Lang="DE" UserCode="123456" UserType="M" UserName="EBOOKERS" UserFirstName="CH" Mode="Test"> <Fab Key="K0000 00"> <TOCode>KUON</TOCode> <Catalog>NEFB</Catalog> <Creator>CTS</Creator> <Fat ServiceType="T" SegRef="0"> <StartDate>03092009</StartDate> <Dep>PAR</Dep> <Arr>RAK</Arr> <Carrier>TO</Carrier> <FlightNr/> <Persons>12</Persons> </Fat> <Fat ServiceType="T" SegRef="1"> <StartDate>10092009</StartDate> <Dep>RAK</Dep> <Arr>PAR</Arr> <Carrier>TO</Carrier> <FlightNr/> <Persons>12</Persons> </Fat> <Fah ServiceType="H" SegRef="2"> <StartDate>03092009</StartDate> <Duration>7</Duration> <Destination>RAK</Destination> <Product>57346V</Product> <Room>1M</Room> <Meal>AI</Meal> <Persons>12</Persons> </Fah> <Fap ID="1"> <PersonType>M</PersonType> <Name>AAAA</Name> </Fap> <Fap ID="2"> <PersonType>C</PersonType> <Name>AAAA</Name> </Fap> </Fab> </Request>]]> </request> </ForwardRequest> </soap:Body></soap:Envelope> Just concentrate on CDATA part: ...<ForwardRequest xmlns="http://webservices.xx.xx"> <request><![CDATA[<Request ......</ForwardRequest></Request>]]> </request> I hope i have been able to explain properly.I haven't started on the point 2 yet, so no remarks at this stage:)Thanks.
  14. Handling Cdata

    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 the moment apply template is not getting executed.2). My second question is regarding the response to be transformed/decoded to CDATA or proper xml. I'm getting a response from a webservice for example: <?xml version="1.0" encoding="utf-8"?><soap:Envelope 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"> <soap:Body> <ForwardRequestResponse xmlns="http://webservices.kuoni.ch"> <ForwardRequestResult><?xml version="1.0" encoding="windows-1252"?><Response Version="2.5" From="KUEKA0" To="EBOOKERS" TermId="EB0001" Window="A" Date="04082009" Time="095322" Type="ERROR" Confirm="YES" Agent="541406" Lang="DE" UserCode="EBOO" UserType="M" UserName="EBOOKERS" UserFirstName="CH" Mode="Test"><Err SegRef="001"><ErrorNr>3706</ErrorNr><ErrorText>Datum für Flug/Transport überprüfen</ErrorText></Err></Response></ForwardRequestResult> </ForwardRequestResponse> </soap:Body></soap:Envelope> Now if you look inside, <ForwardRequestResult> element the text is encoded, how can I decode it to a proper xml form i.e. without these < ? > ect ??Thanks.
×