Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all 935 articles
Browse latest View live

'Xslt' must be a valid XML error for Choose condition

$
0
0

Hi Team,

Currently i have requirement to write simple xslt and use it for Development purpose, when i create to choose conditions its getting error as a Xslt' must be a valid XML error So there have format invalid issue, Could you please support to correct it, For your reference here with attached input xml and current xslt and expected output.

Input xml- 

<?xml version="1.0" encoding="UTF-8"?>
<ns0:utrrada_Order xmlns:ns0="http://utrrada.com/3pl/FMS/XSDLibrary">
<Orders>
   <Order></Order>
   <DocType Variant="ZNB">PO</DocType>
   <Action>CHG</Action>

   <SoldTo>
      <ID>1000</ID>
    </SoldTo>

    <ShipTo>
      <ID>9001</ID>
    </ShipTo>

    <GoodsSupplier>
      <ID>0000602110</ID>
      <Name>NONSNOW LTD</Name>
    </GoodsSupplier>

    <Vendor>
      <ID>0000402062</ID>
      <Name>HON</Name>
    </Vendor>

 </Orders>
</ns0:utrrada_Order>


XSLT-    

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://utrrada.com/3pl/FMS/XSDLibrary" exclude-result-prefixes="ns0">
<xsl:output indent="yes" method="xml" omit-xml-declaration="yes"/>


<xsl:template match="/">
<UniversalShipment xmlns="http://www.case.com/Schemas/Universal/2011/11" version="1.1">
<Shipment>
<DataContext>
                  <DataTargetCollection>
                 <DataTarget>
                     <Type>OrderManagerOrder</Type> 

<xsl:for-each select="ns0:utrrada_Order/Orders">
<xsl:choose>

<xsl:when test="!(ns0:utrrada_Order/Orders/Order == null || ns0:utrrada_Order/Orders/Order.equals(""))"> 

<xsl:value-of select="ns0:utrrada_Order/Orders/Order"/>
</:when>
</xsl:choose>  
</xsl:for-each>


</DataTarget>
   </DataTargetCollection>
    <Company>
<Code>USA</Code>
</Company>
<EnterpriseID>EXK</EnterpriseID>
<ServerID>TST</ServerID>
</DataContext>

<xsl:for-each select="ns0:utrrada_Order/Orders/DocType"> 
      <xsl:choose>
        <xsl:when test="@Variant = 'ZNB' and DocType = 'PO'">

<CustomizedField>
        <DataType>String</DataType>
<Key>PO Type</Key>
<Value>ZNB</Value>
</CustomizedField>            

        </xsl:when>
</xsl:choose>
 </xsl:for-each>


</Shipment>
</UniversalShipment>
</xsl:template>
</xsl:stylesheet> 

expected output- 

           

<UniversalShipment xmlns="http://www.case.com/Schemas/Universal/2011/11" version="1.1">
  <Shipment>
    <DataContext>
      <DataTargetCollection>
        <DataTarget>
          <Type>OrderManagerOrder</Type>

        </DataTarget>
      </DataTargetCollection>
      <Company>
        <Code>USA</Code>
      </Company>
      <EnterpriseID>EXK</EnterpriseID>
      <ServerID>TST</ServerID>
    </DataContext>

<CustomizedField>
        <DataType>String</DataType>
<Key>PO Type</Key>
<Value>ZNB</Value>
</CustomizedField>  

  </Shipment>
</UniversalShipment>



XSLT not a valid format issue

$
0
0

When i  write simple xslt for Development purpose, when i have create a mapping conditions its getting error as a XSLT not a valid format error So there have format invalid issue according to data not mapped, Could you please support to correct it, For your reference here with attached input xml and current xslt and expected output.

Sample Input-

 

<?xml version="1.0" encoding="UTF-8"?>

<ns0:utrrada_Order xmlns:ns0="http://utrrada.com/3pl/FMS/XSDLibrary">
<Orders>
   <Order>4202623821</Order>
   <Action>CHG</Action>


    <DateTime>
      <Date DateQualifier="PODate">20190628</Date>
    </DateTime>
    <MessageID>0000000801362405</MessageID>

    <OrderDetails>
      <LineNum>00010</LineNum>
      <DateTime>
    <Date DateQualifier="DeliveryDate">20191021</Date>
      </DateTime>
      <Price>
           <Amount Type="Net">15.80</Amount>
      </Price
    </OrderDetails>
 </Orders>
</ns0:utrrada_Order>

Issue XSLT-

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://utrrada.com/3pl/FMS/XSDLibrary" exclude-result-prefixes="ns0">
<xsl:output indent="yes" method="xml" omit-xml-declaration="yes"/>


<xsl:template match="/">
<UniversalShipment xmlns="http://www.case.com/Schemas/Universal/2011/11" version="1.1">
<Shipment>

<DataContext>
<DataTargetCollection>
<DataTarget>
<Type>OrderManagerOrder</Type>

<xsl:for-each select="ns0:utrrada_Order/Orders"> 
<xsl:choose>
<xsl:when test="not(Order[.= ''])">  
<Key><xsl:value-of select="Order"/></Key>
</xsl:when>
<xsl:otherwise>
<!--No Order element-->
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>

</DataTarget>
</DataTargetCollection>
<Company>
<Code>USA</Code>
</Company>
<EnterpriseID>EXK</EnterpriseID>
<ServerID>TST</ServerID>
</DataContext>


<CustomizedFieldCollection>


<!--PODate -->
<xsl:for-each select="ns0:utrrada_Order/Orders/DateTime/Date"> 
<xsl:choose>
<xsl:when test="@DateQualifier = 'PODate'">
<DateCollection>
                           <Date>
                             <Type>OrderDate</Type>
                             <IsEstimate>false</IsEstimate>
                             <Value><xsl:value-of select="Date"/></Value>  <!--2019-09-12T15:23:00-->
   </Date>
</DateCollection>

</xsl:when>
</xsl:choose>
</xsl:for-each>


</CustomizedFieldCollection>


<!--DeliveryDate-->
<xsl:for-each select="ns0:utrrada_Order/Orders/OrderDetails/DateTime/Date">
<xsl:choose>
<xsl:when test="@DateQualifier = 'DeliveryDate'">
   <LocalProcessing>
      <DeliveryRequiredBy>
  <xsl:value-of select="ns0:utrrada_Order/Orders/OrderDetails/DateTime/Date"/> 
      </DeliveryRequiredBy>
  </LocalProcessing>
</xsl:when>
</xsl:choose>
</xsl:for-each

</Shipment>
</UniversalShipment>
</xsl:template>
</xsl:stylesheet>

Sample output- 

<UniversalShipment xmlns="http://www.case.com/Schemas/Universal/2011/11" version="1.1">
  <Shipment>
    <DataContext>
      <DataTargetCollection>
        <DataTarget>
          <Type>OrderManagerOrder</Type>
          <Order>4202623821</Order>
        </DataTarget>
      </DataTargetCollection>
      <Company>
        <Code>USA</Code>
      </Company>
      <EnterpriseID>EXK</EnterpriseID>
      <ServerID>TST</ServerID>
    </DataContext>

<DateCollection>
<Date>
        <Type>OrderDate</Type>
        <IsEstimate>false</IsEstimate>
        <Value>2019-08-10T14:00:00</Value>
 </Date>
</DateCollection>

<LocalProcessing>
      <DeliveryRequiredBy>2019-10-21T00:00:00</DeliveryRequiredBy>
</LocalProcessing>

  </Shipment>
</UniversalShipment>

Date Format change on XSLT

$
0
0

Hi Team, 

Currently i have a  requirement to convert to  datetime format on the xslt level, Could you please support to sort out my concern,

Current mapping output-

<LocalProcessing>
<DeliveryRequiredBy>20191021</DeliveryRequiredBy>
</LocalProcessing>

Required format-:

<LocalProcessing>
<DeliveryRequiredBy>2019-10-21T00:00:00.00</DeliveryRequiredBy>
</LocalProcessing>

Uploading dxdiag.xml equals ERROR

$
0
0
Im trying to register for the tech alpha for flight simulator and im failing to upload the dxdiag.xml file needed. I've browsed through the web and unplugged different usb's and tried converting a dxdiag.txt to an XML via online converters but none of that worked. How may i solve this?

Compiling JScript/CSharp scripts is not supported XSLCompiledTransform error

$
0
0

Can someone please help.

I keep getting XSLT compile error, and Inner Exception Compiling JScript/CSharp scripts is not supported.

XML FILE:

<?xml version="1.0" encoding="utf-8"?>
<Document>
<ECOHeader>
<senderID>1</senderID>
<receiverID>1</receiverID>
<transactionSet>1</transactionSet>
<transactionID>1</transactionID>
</ECOHeader>
<SenderIdentification>
<senderID>1</senderID>
</SenderIdentification>
<ReceiverIdentification>
<receiverID>1</receiverID>
</ReceiverIdentification>
<ControlNumber>
<number>1</number>
</ControlNumber>
<DocumentTag>
<version>1</version>
</DocumentTag>
<Consignment>
<ConsignmentDetail>1</ConsignmentDetail>
<QuantityDetail>1</QuantityDetail>
</Consignment>
<StatusDetailsLoop>
<BKD>
<MovementDetail>1</MovementDetail>
<DateTime>1</DateTime>
<Airport>1</Airport>
<QuantityDetail>1</QuantityDetail>
<TimeOfDepartureInformation>1</TimeOfDepartureInformation>
<TimeOfArrivalInformation>1</TimeOfArrivalInformation>
</BKD>
</StatusDetailsLoop>
</Document>

XSL FILE:

<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="mynamespace" exclude-result-prefixes="msxsl user">
  <xsl:output encoding="iso-8859-1" indent="yes" />
  <xsl:template match="Document">
    <xsl:variable name="AirWayBillNumber" select="string(./Consignment/ConsignmentDetail)" />
    <xsl:variable name="AirportCode" select="string(user:GetAirportCode($AirWayBillNumber,number('6')))" />
    <Document>
      <ECOHeader>
        <senderID>
          <xsl:value-of select="./ECOHeader/senderID" />
        </senderID>
        <receiverID>
          <xsl:value-of select="./ECOHeader/receiverID" />
        </receiverID>
        <transactionSet>
          <xsl:call-template name="GetAirTtrackerCustomerDocumentType">
            <xsl:with-param name="id" select="./ECOHeader/receiverID" />
          </xsl:call-template>
        </transactionSet>
        <referenceNo>
          <xsl:value-of select="user:GetReferenceNumber($AirWayBillNumber,6)" />
        </referenceNo>
        <transactionID />
        <senderLocale>
          <xsl:value-of select="./Header/senderLocale" />
        </senderLocale>
        <receiverLocale>
          <xsl:value-of select="./ECOHeader/receiverLocale" />
        </receiverLocale>
      </ECOHeader>
      <Header>
         <xsl:variable name="hdrQtyDetail" select="./Consignment/QuantityDetail" />
        <Consignment>
          <AirportPrefix>
            <xsl:value-of select="substring-before(./Consignment/ConsignmentDetail,'-')" />
          </AirportPrefix>
          <AWBIdentification>
            <xsl:value-of select="user:GetReferenceNumber($AirWayBillNumber,6)" />
          </AWBIdentification>
          <AirportOrigin>
            <xsl:value-of select="substring($AirportCode,1,string-length($AirportCode)-3)" />
          </AirportOrigin>
          <AirportDestination>
            <xsl:value-of select="substring($AirportCode,4,string-length($AirportCode)-3)" />
          </AirportDestination>
          <QtyShipmentDescriptionCode>
            <xsl:value-of select="substring($hdrQtyDetail,0,2)" />
          </QtyShipmentDescriptionCode>
          <QtyDetailNoOfPieces>
            <xsl:call-template name="GetQtyData">
              <xsl:with-param name="node" select="$hdrQtyDetail" />
              <xsl:with-param name="trimChar" select="substring-after($hdrQtyDetail,'T')" />
              <xsl:with-param name="trim2Char" select="substring-after($hdrQtyDetail,'P')" />
            </xsl:call-template>
          </QtyDetailNoOfPieces>
          <xsl:call-template name="GetQtyWeightData">
            <xsl:with-param name="node" select="$hdrQtyDetail" />
            <xsl:with-param name="trimChar" select="substring-after($hdrQtyDetail,'K')" />
            <xsl:with-param name="trimChar2" select="substring-after($hdrQtyDetail,'L')" />
          </xsl:call-template>
        </Consignment>
        <FlightIdentification>
          <xsl:call-template name="GetCarrierAndFlightNumber">
            <xsl:with-param name="node" select="./MovementDetail"></xsl:with-param>
          </xsl:call-template>
        </FlightIdentification>
        <genericContent>
          <ATTransactionId />
          <ShipperName>
            <xsl:if test="local-name()='RCS' or local-name()='FOH'">
              <xsl:value-of select="./ReceiveFromDetail" />
            </xsl:if>
          </ShipperName>
          <TotalNoOfPieces>
             <xsl:call-template name="GetQtyData">
              <xsl:with-param name="node" select="$hdrQtyDetail" />
              <xsl:with-param name="trimChar" select="substring-after($hdrQtyDetail,'T')" />
            </xsl:call-template>
          </TotalNoOfPieces>
        </genericContent>
      </Header>
      <Detail>
        <xsl:for-each select="./StatusDetailsLoop">
          <xsl:call-template name="GetAllStatusDetails">
            <xsl:with-param name="node" select="RCS|RCT|RCF|BKD|MAN|DEP|PRE|TRM|TFD|NFD|AWD|CCD|DLV|DIS|CRC|DDL|TGC|ARR|AWR|FOH" />
          </xsl:call-template>
        </xsl:for-each>
      </Detail>
      <Summary>
        <xsl:for-each select="./Customs">
          <Customs>
            <xsl:copy-of select="*" />
          </Customs>
        </xsl:for-each>
        <xsl:for-each select="./UnitLoadDevice">
          <UnitLoadDevice>
            <xsl:copy-of select="*" />
          </UnitLoadDevice>
        </xsl:for-each>
        <xsl:for-each select="./OtherServiceInformation">
          <OtherServiceInformation>
            <xsl:copy-of select="*" />
          </OtherServiceInformation>
        </xsl:for-each>
      </Summary>
    </Document>
  </xsl:template>
  <!-- Start of Utility Templates-->
  <xsl:template name="GetAirTtrackerCustomerDocumentType">
    <xsl:param name="id" />
    <xsl:choose>
      <!-- If there is a new customer that will use AirTracker, 
please add the document type here-->
      <xsl:when test="$id = '1'">1</xsl:when>
    </xsl:choose>
  </xsl:template>
  <xsl:template name="GetAllStatusDetails">
    <xsl:param name="node" />
    <xsl:for-each select="$node">     
      <!-- Variable Declarion -->
          <xsl:variable name="linQtyDetail" select="./QuantityDetail" />
          <xsl:variable name="linAirport" select="./Airport" />
          <xsl:variable name="strDate" select="./DateTime"></xsl:variable>
          <xsl:variable name="depTime" select="./TimeOfDepartureInformation"></xsl:variable>
          <xsl:variable name="arrTime" select="./TimeOfArrivalInformation"></xsl:variable>
          <!-- End of Variable Declaration -->
      <StatusDetails>
        <StatusCode>
          <xsl:value-of select="local-name()" />
        </StatusCode>
        <xsl:copy-of select="*" />
        <genericContent>
          <StatusDescription />
          <DateTime>
            <xsl:call-template name="FormatDate">
              <xsl:with-param name="yyyy" select="user:getDate()"></xsl:with-param>
              <xsl:with-param name="mmm" select="substring($strDate,3,3)"></xsl:with-param>
              <xsl:with-param name="dd" select="substring($strDate,1,2)"></xsl:with-param>
              <xsl:with-param name="actualTime" select="substring($strDate,6,4)"></xsl:with-param>
              <xsl:with-param name="actualTime2" select="$depTime"></xsl:with-param>
            </xsl:call-template>
          </DateTime>
          <DateTimeDescription>
            <xsl:call-template name="GetDateDescription">
              <xsl:with-param name="node" select="local-name()"></xsl:with-param>
            </xsl:call-template>
          </DateTimeDescription>
          <QtyShipmentDescriptionCode>
            <xsl:value-of select="substring(./QuantityDetail,0,2)" />
          </QtyShipmentDescriptionCode>
          <QtyDetailNoOfPieces>
            <xsl:call-template name="GetQtyData">
              <xsl:with-param name="node" select="$linQtyDetail" />
              <xsl:with-param name="trimChar" select="substring-after($linQtyDetail,'T')" />
              <xsl:with-param name="trim2Char" select="substring-after($linQtyDetail,'P')" />
            </xsl:call-template>
          </QtyDetailNoOfPieces>
          <xsl:call-template name="GetQtyWeightData">
            <xsl:with-param name="node" select="$linQtyDetail" />
            <xsl:with-param name="trimChar" select="substring-after($linQtyDetail,'K')" />
            <xsl:with-param name="trimChar2" select="substring-after($linQtyDetail,'L')" />
          </xsl:call-template>
          <xsl:call-template name="GetCarrierAndFlightNumber">
            <xsl:with-param name="node" select="./MovementDetail"></xsl:with-param>
          </xsl:call-template>
          <AirportCodeDeparture>
            <xsl:value-of select="substring($linAirport,1,string-length($linAirport)-3)" />
          </AirportCodeDeparture>
          <AirportCodeArrival>
            <xsl:value-of select="substring($linAirport,4,string-length($linAirport)-3)" />
          </AirportCodeArrival>
          <ReceivedFromDetail>
            <xsl:value-of select="./ReceiveFromDetail" />
          </ReceivedFromDetail>
          <DateTimeOfDeparture>
            <xsl:if test="string-length($depTime) &gt; 0">
            <xsl:call-template name="FormatDate">
              <xsl:with-param name="yyyy" select="user:getDate()"></xsl:with-param>
              <xsl:with-param name="mmm" select="substring($strDate,3,3)"></xsl:with-param>
              <xsl:with-param name="dd" select="substring($strDate,1,2)"></xsl:with-param>
              <xsl:with-param name="actualTime" select="substring($strDate,6,4)"></xsl:with-param>
              <xsl:with-param name="actualTime2" select="$depTime"></xsl:with-param>
            </xsl:call-template>
           </xsl:if>
          </DateTimeOfDeparture>
          <DateTimeOfArrival>
            <xsl:choose>
<xsl:when test="string-length($arrTime) &gt; 0">
  <xsl:call-template name="FormatDate">
<xsl:with-param name="yyyy" select="user:getDate()"></xsl:with-param>
<xsl:with-param name="mmm" select="substring($strDate,3,3)"></xsl:with-param>
<xsl:with-param name="dd" select="substring($strDate,1,2)"></xsl:with-param>
<xsl:with-param name="actualTime" select="substring($strDate,6,4)"></xsl:with-param>
<xsl:with-param name="actualTime2" select="$arrTime"></xsl:with-param>
  </xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="FormatDate">
<xsl:with-param name="yyyy" select="user:getDate()"></xsl:with-param>
<xsl:with-param name="mmm" select="substring($strDate,3,3)"></xsl:with-param>
<xsl:with-param name="dd" select="substring($strDate,1,2)"></xsl:with-param>
<xsl:with-param name="actualTime" select="substring($strDate,6,4)"></xsl:with-param>
  </xsl:call-template>
</xsl:otherwise>
</xsl:choose>
          </DateTimeOfArrival>
          <VolumeDetail>
            <xsl:value-of select="./VolumeDetail" />
          </VolumeDetail>
          <DensityGroup>
            <xsl:value-of select="./DensityGroup" />
          </DensityGroup>
          <NotificationOrDeliveryDetail>
            <xsl:value-of select="./NotificationOrDeliveryDetail" />
          </NotificationOrDeliveryDetail>
          <TransferReference>
            <xsl:value-of select="./TransferReference" />
          </TransferReference>
          <TransferredDetail>
            <xsl:value-of select="./TransferredDetail" />
          </TransferredDetail>
        </genericContent>
      </StatusDetails>
    </xsl:for-each>
  </xsl:template>
  <xsl:template name="FormatDate">
    <xsl:param name="date" />
    <xsl:param name="yyyy" />
    <xsl:param name="mmm" />
    <xsl:param name="dd" />
    <xsl:param name="actualTime" />
    <xsl:param name="actualTime2" />
    <xsl:variable name="cMonth">
      <xsl:choose>
        <xsl:when test="$mmm = 'JAN'">01</xsl:when>
        <xsl:when test="$mmm = 'FEB'">02</xsl:when>
        <xsl:when test="$mmm = 'MAR'">03</xsl:when>
        <xsl:when test="$mmm = 'APR'">04</xsl:when>
        <xsl:when test="$mmm = 'MAY'">05</xsl:when>
        <xsl:when test="$mmm = 'JUN'">06</xsl:when>
        <xsl:when test="$mmm = 'JUL'">07</xsl:when>
        <xsl:when test="$mmm = 'AUG'">08</xsl:when>
        <xsl:when test="$mmm = 'SEP'">09</xsl:when>
        <xsl:when test="$mmm = 'OCT'">10</xsl:when>
        <xsl:when test="$mmm = 'NOV'">11</xsl:when>
        <xsl:when test="$mmm = 'DEC'">12</xsl:when>
      </xsl:choose>
    </xsl:variable>
    <!--
      Actual Time A, Estimated Time E, Scheduled Time S -->
    <xsl:variable name="arrOrDepTime">
       <xsl:choose>
          <xsl:when test="contains($actualTime2,'A')">
        <xsl:value-of select="substring-after($actualTime2,'A')" />
      </xsl:when>
      <xsl:when test="contains($actualTime2,'S')">
        <xsl:value-of select="substring-after($actualTime2,'S')" />
      </xsl:when>
        <xsl:when test="contains($actualTime2,'E')">
        <xsl:value-of select="substring-after($actualTime2,'E')" />
      </xsl:when>
      </xsl:choose>
    </xsl:variable>
    <xsl:choose>
      <xsl:when test="string-length($actualTime) &gt; 0">
        <xsl:value-of select=" concat ($yyyy,'-',$cMonth,'-',$dd,'T',$actualTime) " />
      </xsl:when>
      <xsl:when test="string-length($arrOrDepTime) &gt; 0">
        <xsl:value-of select=" concat ($yyyy,'-',$cMonth,'-',$dd,'T',$arrOrDepTime)" />
      </xsl:when>
      <xsl:when test="string-length($arrOrDepTime) &gt; 0">
        <xsl:value-of select=" concat ($yyyy,'-',$cMonth,'-',$dd,'T',$arrOrDepTime) " />
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select=" concat ($yyyy,'-',$cMonth,'-',$dd,'T','000000') " />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  <xsl:template name="GetQtyData">
    <xsl:param name="node" />
    <xsl:param name="trimChar" />
    <xsl:param name="trim2Char" />
    <xsl:choose>
      <xsl:when test="contains($trim2Char,'K')">
        <xsl:value-of select="substring-before($trim2Char,'K')" />
      </xsl:when>
      <xsl:when test="contains($trim2Char,'L')">
        <xsl:value-of select="substring-before($trim2Char,'L')" />
      </xsl:when>
      <xsl:when test="contains($trimChar,'L')">
        <xsl:value-of select="substring-before($trimChar,'L')" />
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="substring-before($trimChar,'K')" />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  <xsl:template name="GetCarrierAndFlightNumber">
    <xsl:param name="node"></xsl:param>
    <Carrier>
      <xsl:value-of select="substring($node,1,string-length($node)-3)" />
    </Carrier>
    <FlightNumber>
      <xsl:value-of select="substring($node,3,string-length($node)-2)" />
    </FlightNumber>
  </xsl:template>
  <xsl:template name="GetQtyWeightData">
    <xsl:param name="node" />
    <xsl:param name="trimChar" />
    <xsl:param name="trim2Char" />
    <xsl:choose>
      <xsl:when test="contains($node,'L')">
        <QtyDetailWeightCode>
          <xsl:value-of select="substring($node,string-length(substring-before($node,'L'))+1,1)" />
        </QtyDetailWeightCode>
        <QtyDetailWeight>
          <xsl:value-of select="substring-after($node,'L')" />
        </QtyDetailWeight>
      </xsl:when>
      <xsl:otherwise>
        <QtyDetailWeightCode>
          <xsl:value-of select="substring($node,string-length(substring-before($node,'K'))+1,1)" />
        </QtyDetailWeightCode>
        <QtyDetailWeight>
          <xsl:value-of select="substring-after($node,'K')" />
        </QtyDetailWeight>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  <xsl:template name="GetDateDescription">
    <xsl:param name="node"></xsl:param>
    <xsl:variable name="cNodeName">
      <xsl:choose>
        <xsl:when test="$node = 'RCS'">Receipt</xsl:when>
        <xsl:when test="$node = 'RCT'">Transfer Carrier</xsl:when>
        <xsl:when test="$node = 'RCF'">Scheduled Arrival</xsl:when>
        <xsl:when test="$node = 'BKD'">Booked</xsl:when>
        <xsl:when test="$node = 'MAN'">Manifest</xsl:when>
        <xsl:when test="$node = 'DEP'">Scheduled Departure</xsl:when>
        <xsl:when test="$node = 'PRE'">Prepared for Loading</xsl:when>
        <xsl:when test="$node = 'TRM'"></xsl:when>
        <xsl:when test="$node = 'TFD'">Transfer</xsl:when>
        <xsl:when test="$node = 'NFD'">Notification</xsl:when>
        <xsl:when test="$node = 'AWD'">Delivery</xsl:when>
        <xsl:when test="$node = 'CCD'">Clearance</xsl:when>
        <xsl:when test="$node = 'DLV'">Delivery</xsl:when>
        <xsl:when test="$node = 'DIS'">Discrepancy</xsl:when>
        <xsl:when test="$node = 'CRC'">Reporting</xsl:when>
        <xsl:when test="$node = 'DDL'">Delivery to consignee's door</xsl:when>
        <xsl:when test="$node = 'TGC'">Transfer</xsl:when>
        <xsl:when test="$node = 'ARR'">Scheduled Arrival</xsl:when>
        <xsl:when test="$node = 'AWR'">Scheduled Arrival</xsl:when>
        <xsl:when test="$node = 'FOH'">Receipt</xsl:when>
      </xsl:choose>
    </xsl:variable>
    <xsl:value-of select="$cNodeName" />
  </xsl:template>
  <msxsl:script language="VBScript" implements-prefix="user">
  <![CDATA[

Function GetAirportCode(ByVal str, Byval noOfchar)
Dim strOrig
    Dim iNum
    
    strOrig = Cstr(str)
    iNum = CInt(noOfchar)
 
GetAirportCode = Right(strOrig, iNum)

End Function

Function GetReferenceNumber(ByVal str, Byval noOfchar)

Dim strOrig
Dim strlength
    Dim iNum

strOrig = Cstr(str)
    iNum = CInt(noOfchar)
strLength = Len(strOrig)

GetReferenceNumber = Left(strOrig, strLength - iNum)

End Function

  Function getDate() 

   strMonth = Month(now) 
   strDay = Day(now)
   intDay = len(Day(now))
   intMonth = len(Month(now))
 
   If intDay = 1 then

     strDay = "0" & Day(now)

   End If
 
   If intMonth = 1 then

     strMonth = "0" & Month(now)

   End If
   
   getDate = Year(now) 
End Function 

]]></msxsl:script>
</xsl:stylesheet>

Error message when uploading XML file to Microsoft Flight Simulator 2020 Tech Alpha Registration

$
0
0

Hi everyone,

I keep getting an error message when uploading the DxDiag xml file to the website, the message says "error uploading file"

I've tried two different browsers, Chrome and Edge, neither worked. I've also tried saving it as a text document then converting it into an xml, didn't work either.

This is the last day for the singup, so please can you assist.

Thanks.


How to update the Microsoft data access table column value which is OLE Object type.

$
0
0

hi,

Actually I have to modify the column value, which is XML string, in MDB datatable. Due to that column type is OLE Object, I couldn't see the actual data. Can anyone help me how to modify the data?



MSXML 6.0 Bug reports

$
0
0

Hi,

Can anyone point me where I can log a bug report for MSXML 6 (v6.30.17134.1067)?  All resources I've come across simply points to this forum and dead links.

Thanks


Generate xml tree structure as xml

$
0
0
I have xml file. I need to generate xml tree structure as xml 

     <DTS:Executables>
        <DTS:Executable
          DTS:refId="Package\Data Flow Task"
          DTS:CreationName="SSIS.Pipeline.3"
          DTS:Description="Data Flow Task"
          DTS:DTSID="{0D0F87B4-DE1E-4EE0-AD21-B7911324C733}"
          DTS:ExecutableType="SSIS.Pipeline.3"
          DTS:LocaleID="-1"
          DTS:ObjectName="Data Flow Task"
          DTS:TaskContact="Performs high-performance data extraction, transformation and loading;Microsoft Corporation; Microsoft SQL Server; (C) Microsoft Corporation; All Rights Reserved;http://www.microsoft.com/sql/support/default.asp;1">
          <DTS:Variables />
          <DTS:ObjectData>
            <pipeline
              version="1" />
          </DTS:ObjectData>
        </DTS:Executable>
      </DTS:Executables>

I need to generate xml tree as xml file

I try 

    <content name="DTS:Executables" contentType="ExecutableDFT">
       <property name="DTS:Executable" att_name="DTS:ObjectName" />
    <property name="DTS:Executable" att_name="DTS:Description" />
    <property name="DTS:Executable" att_name="DTS:DTSID" />
    <
    <content name="DTS:ObjectData">
    <content name="pipeline">
    <content name="components">
    <content name="" recolect="true">
    <property name="component" att_name="name" />
    <property name="component" att_name="description" />
    <content name="properties">
    <property name="property" att_name="SqlCommand" />
    <property name="property" att_name="SqlCommandVariable" />
    <property name="property" att_name="VariableName" />
    </content>
    <content name="connections">
    <property name="connection" att_name="name"  />
    <property name="connection" att_name="connectionManagerID"  />
    </content>
    </content>
    </content>
   
    </content>
    </content>
    </content>

Determine if Nodes are the Same - VC++ MSXML DOM 6

$
0
0

I have a situation where I need to uniquely identify MSXML DOM nodes (IXMLDOMNode) to use as keys in a container, even if they come from different function calls (such as different xpaths that yield the same node). It would be alright for it to be unique pointers, IDs, or even paths; as long as it is unique for every node and always the same no matter how the node was obtained.

It appears that every call to a function like selectNodes creates a IXMLDOMNode wrapper around the actual object. I examined the data in the debugger and saw that IXMLDOMNode objects representing node have the same _pNode pointer in them, but the IXMLDOMNode objects themselves are different. However, there seems to be no way to get at the underlying object or determine that those underlying objects are the same.

Any suggestions would be appreciated.

adding countdown to boot menu

$
0
0

Hi all, I would like to add a countdown timer to the following menu below...say, 5 seconds and if no choice is selected by the user, "c" is auto selected. Can anyone help?

<?xml version="1.0" encoding="UTF-8" ?>
<Config>
    <Menu>
        <Topic Delay="-1">
            <Text>Select an item by using the keyboard:</Text>
        </Topic>
        <Entry Key="1">
            <Text>1. Acronis True Image (64-bit)</Text>
            <LoadKernel>
                <Kernel Arguments="&#32; quiet" Path="dat10.dat" />
                <Ramdisk Path="dat11.dat" />
                <Ramdisk Path="dat12.dat" />
                <Hash Path="sgn13.sgn" />
            </LoadKernel>
        </Entry>
        <Entry Key="2">
            <Text>2. Acronis System Report (64-bit)</Text>
            <LoadKernel>
                <Kernel Arguments="product=system_report quiet" Path="dat14.dat" />
                <Ramdisk Path="dat15.dat" />
                <Ramdisk Path="dat16.dat" />
                <Hash Path="sgn17.sgn" />
            </LoadKernel>
        </Entry>
        <Entry Key="c">
            <Text>c. Continue booting</Text>
            <Chainload />
        </Entry>
    </Menu>
</Config>

XSLT-displaying the number followed by alphabets

$
0
0
<PassengerList>
<SeatNumber>1A</SeatNumber>
<SeatNumber>1B</SeatNumber>
<SeatNumber>1D</SeatNumber>
<SeatNumber>1E</SeatNumber>
<SeatNumber>1F</SeatNumber>
<SeatNumber>1G</SeatNumber>
<SeatNumber>2B</SeatNumber>
<SeatNumber>2D</SeatNumber>
<SeatNumber>3A</SeatNumber>
<SeatNumber>3B</SeatNumber>
<SeatNumber>3D</SeatNumber>
<SeatNumber>3E</SeatNumber>
<SeatNumber>4A</SeatNumber>
<SeatNumber>4B</SeatNumber>
<SeatNumber>4E</SeatNumber>
<SeatNumber>4F</SeatNumber>
<SeatNumber>4G</SeatNumber>
<SeatNumber>4J</SeatNumber>
</PassengerList>

I need the output to be:

1ABDEFG2BD3ABDE4ABEFGJ

Note: Outputtype = "text"
I am strugglling for the last 2 days for this required output. Can you please help me in displaying like above with numbers followed by alphabets.

//xmllite1.rssing.com/chan-14789260/article893-live.html

$
0
0

...and .NET Framework?>

Well, I'll BEA monkey's uncle. 

It's a deceptively short grammatically incorrect question with an exceedingly short answer.

Try it in IE7/FIrefox/VS2005, the answer is apparently "no."   Nothing in MSXML 6.0 about XML Schema 1.1

Opinions, gripes, thoughts, theories, and even, "w.t.f.?" appreciated.

I've read the rationale here.  Check.  Fresh ink.

I understand the burning desire...to break competitor's code.  Check.

But why would someone in the same company do this now to break their own code?  That's my current "w.t.f.?"

 

 

 

 

 

 

 

 

 

 

 

 

The element has an invalid child element in namespace

$
0
0

I am getting this error when validating my xml data:

'The Invoice element has an invalid child DocumentCurrencyCode element in namespace urn: oasis: names: specification: ubl: schema: xsd: CommonBasicComponents-2.
List of possible expected elements: Note in namespace urn: oasis: names: specification: ubl: schema: xsd: CommonBasicComponents-2.'

This is the element in my xml:

<DocumentCurrencyCode xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">EUR</DocumentCurrencyCode>

These are my XML schema's:

<?xml version="1.0" encoding="utf-8"?><!-- Created with Liquid Technologies Online Tools 1.0 (https://www.liquid-technologies.com) --><xs:schema xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:Invoice" xmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:import schemaLocation="schema1.xsd" namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" /><xs:import schemaLocation="schema2.xsd" namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" /><xs:element name="Invoice"><xs:complexType><xs:sequence><xs:element ref="cbc:CustomizationID" /><xs:element ref="cbc:ProfileID" /><xs:element ref="cbc:ID" /><xs:element ref="cbc:IssueDate" /><xs:element ref="cbc:DueDate" /><xs:element ref="cbc:InvoiceTypeCode" /><xs:element ref="cbc:Note" /><xs:element ref="cbc:DocumentCurrencyCode" /><xs:element maxOccurs="unbounded" ref="cac:InvoiceLine" /></xs:sequence></xs:complexType></xs:element></xs:schema>
<?xml version="1.0" encoding="utf-8"?><!-- Created with Liquid Technologies Online Tools 1.0 (https://www.liquid-technologies.com) --><xs:schema xmlns:tns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:element name="CustomizationID" type="xs:string" /><xs:element name="ProfileID" type="xs:string" /><xs:element name="ID" type="xs:string" /><xs:element name="IssueDate" type="xs:date" /><xs:element name="DueDate" type="xs:date" /><xs:element name="InvoiceTypeCode" type="xs:unsignedShort" /><xs:element name="Note" type="xs:string" /><xs:element name="DocumentCurrencyCode" type="xs:string" /></xs:schema>


In my Invoice class looks the DocumentCurrencyCode like this:

/// <remarks/>
	[System.Xml.Serialization.XmlElementAttribute(Namespace = "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2")]
	public string DocumentCurrencyCode
	{
		get
		{
			return this.documentCurrencyCodeField;
		}
		set
		{
			this.documentCurrencyCodeField = value;
		}
	}

Can someone tell me please what is wrong here?

Thank you!


Serialize without xmlns

$
0
0

Hi,

I'm trying to serialize a object without namespaces. I tried this:

XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
ns.Add("", "");
XmlSerializer slz = new XmlSerializer(someType);
slz.Serialize(myXmlTextWriter, someObject, ns);

But it does not work? i get all my elements with namespaces:

<ID xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">2190583</ID><IssueDate xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">2019-11-15</IssueDate>

How to prevent that?


What version of MsXml is used as default by MsXsl.exe

$
0
0

Hi Team,

We currently have MsXml versions 3.0, 4.0 and 7.0 on our Windows 2012 server. We use MsXsl.exe to process xslt files into csv in our application. MsXml version 4.0 has been flagged by our infra team that it should be removed as it is no longer in Microsoft support. We found that MsXsl.exe we use is of version 4.0 and assume it consumes MsXml 4.0.

Could you please help us with below questions,

  1. How to find what version of MsXml is called/consumed by our MsXsl.exe(4.0)
  2. What is the default version of MsXml for MsXsl.exe(version 4.0)
  3. How to manually force MsXsl.exe to point to a different MsXml version
  4. The latest version of MsXsl.exe we could download from (https://www.microsoft.com/en-au/download/details.aspx?id=21714) is 3.0. What version of MsXml will it consume by default ?

Thanks and Regards,

Vino

Help on parsing Xml

$
0
0

I am trying to parse the next xml

Euro Bank Rate change

whatever I do I can't get the the rate for USA I get that the node is null for example :

var nsmgr = new XmlNamespaceManager(xmlDocument.NameTable);
            nsmgr.AddNamespace("gesmes", "http://www.gesmes.org/xml/2002-08-01");
            XmlNode node = xmlDocument.SelectSingleNode("/gesmes:Envelope[@xmlns:gesmes=\"http://www.gesmes.org/xml/2002-08-01\"]/Cube/Cube[@time=\"2019-12-18\"]//Cube[1]", nsmgr);
            XmlNodeList nodes = xmlDocument.SelectNodes("//gesmes:Cube", nsmgr);
            XmlNodeList n2odes = xmlDocument.SelectNodes("/gesmes:Envelope/Cube/Cube/Cube", nsmgr);
what do i miss?

Read a large (900 Mb) xml file

$
0
0

I need to read a very large xml file (900 Mb)
(I'am using XmlReader.Create)

Now i'd like to add an option to my app to read only 100000 elements at a time
For example use a button 'Next' to read the next 100000 elements.
(For reading the first 100000 elements i used a for loop)

How do i do this ?

 

How Can i add a wild card condition for XSLT choose

$
0
0

Currently  i have Requirement to add a wildcard condition for a Choose statement condition, i want to filter out and equal first two digit start from  'US' ,  Discharge and LoadPort tags. Below is a my own created script but its not functioninonfg, Could you  please guide me to correct this,

<xsl:for-each select="a:Root/Consol_Details">
  
<xsl:choose>
    <xsl:when test="position() = 2  and   Discharge = 'US*' ">   
 
<RecipientRoleCollection>
        <RecipientRole> 
      <Code>RAG</Code>
  </RecipientRole>
 </RecipientRoleCollection>
  
    </xsl:when>
    <xsl:when test="position() = 2  and   LoadPort = 'US*' ">   
     
<RecipientRoleCollection>
        <RecipientRole> 
      <Code>SAG</Code>
  </RecipientRole>
 </RecipientRoleCollection>
  
    </xsl:when>
  </xsl:choose>
  
</xsl:for-each>

How to Map XML's when Input xml not does not have exact Name space

$
0
0

Hi Team,

Currently i have a requirement to write xslt map to transform one xml format to another format, according to when i trying to map the xml's on the xslt, noticed input xml does not have a exact namespace, Due to the reason i'm still not able to write namespace mapping, According to Could you please support to create header mapping, for yo

Input Sample Xml-:

<?xml version='1.0' encoding='utf-8'?>
<RECORDS>
<Header>
<MessageId>HAWB XML Export</MessageId>
<SendingDate>2018-10-12 16:39:56</SendingDate>
<JobType>AIR IMPORT</JobType>
</Header>
<RECORD>

<Consignee>
<ID>162</ID>
<Name>North TECH CO.,LTD</Name>
<Address>CENTER POWER PARK</Address>
  <Contact>
  <Name></Name>
  <Email></Email>
  <Tel></Tel>
  </Contact>
</Consignee>
<Shipment>
<CargoReadyDate>0000-00-00 00:00:00</CargoReadyDate>
<CargoHandOverDate>0000-00-00</CargoHandOverDate>
<JobType>Direct</JobType>
<AgentID></AgentID>
<Airline>
<ID>65</ID>
<Name>AIR ASIA</Name>
</Airline>
<FlightNo>AU745</FlightNo>
<APOL>SYD</APOL>

</Shipment>
<FlightRouteCount>2</FlightRouteCount>
<FROUTES>

<FROUTE>
<FlightCode>CX</FlightCode>
<FlightNo>611</FlightNo>
<FlightDate>2018-10-17</FlightDate>
<FlightTime>20:15:00</FlightTime>
<FlightAPOL>SYD</FlightAPOL>
<FlightAPOD>CMB</FlightAPOD>
</FROUTE>
</FROUTES>
</RECORD>

</RECORDS>


Current Namespace mapping-:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0= 

<xsl:template match="/">

Output:-

     

<UniversalShipment xmlns="http://www.cse.com/Schemas/Universal/2011/11" version="1.1">
  <Shipment>   
    <DataContext>
      <DataTargetCollection>
        <DataTarget>
          <Type>ForwardingShipment</Type>
          <Key></Key>
        </DataTarget>
      </DataTargetCollection>

      <Company>
        <Code>LK1</Code>        
      </Company>

      <EnterpriseID>EXK</EnterpriseID>
      <ServerID>TST</ServerID> 
    </DataContext>

    <ActualChargeable>1000.000</ActualChargeable>
    <AdditionalTerms></AdditionalTerms>

etc...........

Viewing all 935 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>