Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1362
  • Last Modified:

How to map and remove white spaces XML/XSL

I am a beginner tp xml/xsl and I am trying to build a template but keep getting error. Please view the template, output with errors.
Template
------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
 
    <files>
      <file active="true" ftp="true" ftpdelete="true" ftppath="/webspace/httpdocs/osexp/" filename="OS%realorderid%.xml" path="/export">
 
         <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:php="http://php.net/xsl">
		<xsl:strip-space elements="question"/>
          <xsl:template match="/">
            <xsl:for-each select="orders/order">
              <Order xsi:schemaLocation='urn:schemas-basda-org:2000:purchaseOrder:xdr:3.01 order-v3.xsd
                           urn:schemas-bossfed-co-uk:OP-Order-v1 OP-Order-v1.xsd'
       xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
       xmlns='urn:schemas-basda-org:2000:purchaseOrder:xdr:3.01'>
                <OrderHead>
                  <Schema>
                    <Version>
                      <xsl:text>
3.05
                      </xsl:text>
                    </Version>
                  </Schema>
                  <Parameters>
                    <Language>
                      <xsl:text>
en-GB
                      </xsl:text>
                    </Language>
                    <DecimalSeparator>
                      <xsl:text>
.
                      </xsl:text>
                    </DecimalSeparator>
                    <Precision>
                      <xsl:text>
12.3
                      </xsl:text>
                    </Precision>
                  </Parameters>
                  <OrderType Code='PUO'>
                    <xsl:text>
Purchase Order
                    </xsl:text>
                  </OrderType>
                  <OrderCurrency>
                    <Currency Code='GBP'>
                      <xsl:text>
GB Pounds Sterling
                      </xsl:text>
                    </Currency>
                  </OrderCurrency>
                  <Checksum></Checksum>
                </OrderHead>
                <OrderReferences>
                  <ContractOrderReference>
                    <xsl:text>
1
                    </xsl:text>
                  </ContractOrderReference>
                  <BuyersOrderNumber Preserve='true'>
                    <xsl:text>
PO123456
                    </xsl:text>
                  </BuyersOrderNumber>
                  <SuppliersOrderReference Preserve='true'>
                    <xsl:text>
SO654321
                    </xsl:text>
                  </SuppliersOrderReference>
                </OrderReferences>
                <OP:AdditionalOrderReferences xmlns:OP="urn:schemas-bossfed-co-uk:OP-Order-v1">
                  <OP:OrderReference ReferenceDesc="Order Type">
                    <OP:Reference>
                      <xsl:text>
PWD
                      </xsl:text>
                    </OP:Reference>
                  </OP:OrderReference>
                </OP:AdditionalOrderReferences>
                <OP:AdditionalOrderDates xmlns:OP="urn:schemas-bossfed-co-uk:OP-Order-v1">
                  <OP:OrderDateTime DateTimeDesc="Earliest Time for Delivery">
                    <xsl:text>
10:30:00
                    </xsl:text>
                  </OP:OrderDateTime>
                  <OP:OrderDateTime DateTimeDesc="Latest Time for Delivery">
                    <xsl:text>
15:00:00
                    </xsl:text>
                  </OP:OrderDateTime>
                </OP:AdditionalOrderDates>
                <OP:AdditionalOrderText xmlns:OP="urn:schemas-bossfed-co-uk:OP-Order-v1">
                  <OP:OrderText TextDesc="Legal Information">
                    <xsl:text>
Terms and conditions are as specified in the contract
                    </xsl:text>
                  </OP:OrderText>
                </OP:AdditionalOrderText>
                <OrderDate>
                  <xsl:text>
10am
                  </xsl:text>
                </OrderDate>
                <Supplier>
                  <SupplierReferences>
                    <BuyersCodeForSupplier>
                      <xsl:text>
M2358
                      </xsl:text>
                    </BuyersCodeForSupplier>
                    <GLN>
                      <xsl:text>
5012345654321
                      </xsl:text>
                    </GLN>
                  </SupplierReferences>
                  <Party>
                    <xsl:text>
OfficeSpot Ltd.
                    </xsl:text>
                  </Party>
                  <Address>
                    <Street>
                      <xsl:text>
5, Knockmitten Close
                      </xsl:text>
                    </Street>
                    <Street>
                      <xsl:text>
Western Industrial Estate
                      </xsl:text>
                    </Street>
                    <City>
                      <xsl:text>
Naas Road
                      </xsl:text>
                    </City>
                    <State>
                      <xsl:text>
Dublin
                      </xsl:text>
                    </State>
                    <PostCode>
                      <xsl:text>
12
                      </xsl:text>
                    </PostCode>
                    <Country Code='GB'>
                      <xsl:text>
Ireland
                      </xsl:text>
                    </Country>
                  </Address>
                </Supplier>
                <Buyer>
                  <BuyerReferences>
                    <SuppliersCodeForBuyer>
                      <xsl:text>
BELLI
                      </xsl:text>
                    </SuppliersCodeForBuyer>
                    <GLN>
                      <xsl:text>
5012345678901
                      </xsl:text>
                    </GLN>
                  </BuyerReferences>
                  <Party>
                    <xsl:text>
Scribe Stationers Ltd
                    </xsl:text>
                  </Party>
                  <Address>
                    <Street>
                      <xsl:text>
Scribe House
                      </xsl:text>
                    </Street>
                    <Street>
                      <xsl:text>
Inkwell Road
                      </xsl:text>
                    </Street>
                    <City>
                      <xsl:text>
Manchester
                      </xsl:text>
                    </City>
                    <PostCode>
                      <xsl:text>
M12 3AB
                      </xsl:text>
                    </PostCode>
                    <Country Code='GB'>
                      <xsl:text>
United Kingdom
                      </xsl:text>
                    </Country>
                  </Address>
                  <Contact>
                    <Name>
                      <xsl:text>
Peter Jones
                      </xsl:text>
                    </Name>
                    <Department>
                      <xsl:text>
Purchasing
                      </xsl:text>
                    </Department>
                    <DDI>
                      <xsl:text>
0161 234 5678
                      </xsl:text>
                    </DDI>
                    <Switchboard>
                      <xsl:text>
0161 234 5000
                      </xsl:text>
                    </Switchboard>
                    <Fax>
                      <xsl:text>
0161 235 7890
                      </xsl:text>
                    </Fax>
                  </Contact>
                </Buyer>
                <Delivery>
                  <DeliverTo>
                    <DeliverToReferences>
                      <BuyersCodeForLocation>
                        <xsl:text>
LONGSIGHT
                        </xsl:text>
                      </BuyersCodeForLocation>
                    </DeliverToReferences>
                    <Party>
                      <xsl:text>
Scribe Stationers - Longsight Depot
                      </xsl:text>
                    </Party>
                    <Address>
                      <Street>
                        <xsl:text>
12-16 First Avenue
                        </xsl:text>
                      </Street>
                      <City>
                        <xsl:text>
Manchester
                        </xsl:text>
                      </City>
                      <PostCode>
                        <xsl:text>
M13 5OP
                        </xsl:text>
                      </PostCode>
                      <Country Code='GB'>
                        <xsl:text>
United Kingdom
                        </xsl:text>
                      </Country>
                    </Address>
                    <Contact>
                      <Name>
                        <xsl:text>
Colin Davies
                        </xsl:text>
                      </Name>
                      <Department>
                        <xsl:text>
Goods Inward
                        </xsl:text>
                      </Department>
                      <DDI>
                        <xsl:text>
0161 357 9246
                        </xsl:text>
                      </DDI>
                      <Fax>
                        <xsl:text>
0161 357 9876
                        </xsl:text>
                      </Fax>
                    </Contact>
                  </DeliverTo>
                  <DeliverFrom>
                    <DeliverFromReferences>
                      <BuyersCodeForLocation>
                        <xsl:text>
DIRECT
                        </xsl:text>
                      </BuyersCodeForLocation>
                    </DeliverFromReferences>
                    <Party>
                      <xsl:text>
Universal Manufacturing Limited
                      </xsl:text>
                    </Party>
                    <Contact>
                      <Name>
                        <xsl:text>
Henry Wood
                        </xsl:text>
                      </Name>
                      <Department>
                        <xsl:text>
Despatch
                        </xsl:text>
                      </Department>
                      <DDI>
                        <xsl:text>
0121 0987 6543
                        </xsl:text>
                      </DDI>
                    </Contact>
                  </DeliverFrom>
                  <PreferredDate>
                    <xsl:text>
2002-11-01
                    </xsl:text>
                  </PreferredDate>
                </Delivery>
                <InvoiceTo>
                  <Party>
                    <xsl:text>
Scribe Stationers Ltd
                    </xsl:text>
                  </Party>
                  <Address>
                    <Street>
                      <xsl:text>
Scribe House
                      </xsl:text>
                    </Street>
                    <Street>
                      <xsl:text>
Inkwell Road
                      </xsl:text>
                    </Street>
                    <City>
                      <xsl:text>
Manchesterv
                      </xsl:text>
                    </City>
                    <PostCode>
                      <xsl:text>
M12 3AB
                      </xsl:text>
                    </PostCode>
                    <Country Code='GB'>
                      <xsl:text>
United Kingdom
                      </xsl:text>
                    </Country>
                  </Address>
                  <Contact>
                    <Name>
                      <xsl:text>
Matthew Smith
                      </xsl:text>
                    </Name>
                    <Department>
                      <xsl:text>
Accounts
                      </xsl:text>
                    </Department>
                    <DDI>
                      <xsl:text>
0161 234 5656
                      </xsl:text>
                    </DDI>
                    <Switchboard>
0161 234 5000
                    </Switchboard>
                  </Contact>
                </InvoiceTo>
                <OrderLine TypeDescription='Goods &amp; Services' Action='Add' TypeCode='GDS'>
                  <LineNumber Preserve='true'>
                    <xsl:text>
1
                    </xsl:text>
                  </LineNumber>
                  <OrderLineReferences>
                    <ContractOrderReference>
                      <xsl:text>
C2002/0001
                      </xsl:text>
                    </ContractOrderReference>
                    <CostCentre>
                      <xsl:text>
CC02
                      </xsl:text>
                    </CostCentre>
                  </OrderLineReferences>
                  <Product>
                    <SuppliersProductCode>
                      <xsl:text>
3
                      </xsl:text>
                    </SuppliersProductCode>
                    <BuyersProductCode>
                      <xsl:text>
235623
                      </xsl:text>
                    </BuyersProductCode>
                    <TradedUnitCode>
                      <xsl:text>
5016192986730
                      </xsl:text>
                    </TradedUnitCode>
                    <ConsumerUnitCode>
                      <xsl:text>
5016192986741
                      </xsl:text>
                    </ConsumerUnitCode>
                    <Description>
                      <xsl:text>
A4 Conference folder (25 pack)
                      </xsl:text>
                    </Description>
                    <Properties>
                      <Length UOMDescription='Centimetre' UOMCode='CMT'>
                        <xsl:text>
0
                        </xsl:text>
                      </Length>
                      <Width UOMDescription='Centimetre' UOMCode='CMT'>
                        <xsl:text>
0
                        </xsl:text>
                      </Width>
                      <Color>
                        <xsl:text>
Blue
                        </xsl:text>
                      </Color>
                    </Properties>
                  </Product>
                  <Quantity UOMDescription='Piece' UOMCode='PCE'>
                    <Packsize>
                      <xsl:text>
25
                      </xsl:text>
                    </Packsize>
                    <Amount>
                      <xsl:text>
50
                      </xsl:text>
                    </Amount>
                  </Quantity>
                  <Price UOMDescription='Pack' UOMCode='PCK'>
                    <Units>
1
                    </Units>
                    <UnitPrice>
                      <xsl:text>
1.50
                      </xsl:text>
                    </UnitPrice>
                  </Price>
                  <LineTotal>
                    <xsl:text>
75.00
                    </xsl:text>
                  </LineTotal>
                </OrderLine>
                <OrderLine TypeDescription='Goods &amp; Services' Action='Add' TypeCode='GDS'>
                  <LineNumber Preserve='true'>
                    <xsl:text>
2
                    </xsl:text>
                  </LineNumber>
                  <OrderLineReferences>
                    <ContractOrderReference>
                      <xsl:text>
C2002/0002
                      </xsl:text>
                    </ContractOrderReference>
                    <CostCentre>
                      <xsl:text>
CC03
                      </xsl:text>
                    </CostCentre>
                  </OrderLineReferences>
                  <OP:AdditionalOrderLineReferences xmlns:OP="urn:schemas-bossfed-co-uk:OP-Order-v1">
                    <OP:OrderLineReference ReferenceDesc="Back Order Flag">
                      <OP:Reference>
                        <xsl:text>
Y
                        </xsl:text>
                      </OP:Reference>
                    </OP:OrderLineReference>
                    <OP:OrderLineReference ReferenceDesc="Product Specification">
                      <OP:Reference>
                        <xsl:text>
PS-1234321
                        </xsl:text>
                      </OP:Reference>
                      <OP:ReferenceDate>
                        <xsl:text>
2001-11-10
                        </xsl:text>
                      </OP:ReferenceDate>
                    </OP:OrderLineReference>
                  </OP:AdditionalOrderLineReferences>
                  <Product>
                    <SuppliersProductCode>
                      <xsl:text>
181818
                      </xsl:text>
                    </SuppliersProductCode>
                    <BuyersProductCode>
                      <xsl:text>
SCR-27384
                      </xsl:text>
                    </BuyersProductCode>
                    <TradedUnitCode>
                      <xsl:text>
5016192986790
                      </xsl:text>
                    </TradedUnitCode>
                    <ConsumerUnitCode>
                      <xsl:text>
4074400410000
                      </xsl:text>
                    </ConsumerUnitCode>
                    <Description>
                      <xsl:text>
Tippex 30ml (tray of 20 bottles)
                      </xsl:text>
                    </Description>
                    <Properties>
                      <Other Description="Pallet Percentage" UOMCode="PCT">
                        <xsl:text>
25
                        </xsl:text>
                      </Other>
                    </Properties>
                  </Product>
                  <Quantity UOMDescription='Pack' UOMCode='PCK'>
                    <Packsize>
                      <xsl:text>
20
                      </xsl:text>
                    </Packsize>
                    <Amount>
                      <xsl:text>
15
                      </xsl:text>
                    </Amount>
                  </Quantity>
                  <Price UOMDescription='Pack' UOMCode='PCK'>
                    <UnitPrice>
                      <xsl:text>
10.00
                      </xsl:text>
                    </UnitPrice>
                  </Price>
                  <LineTotal>
                    <xsl:text>
150.00
                    </xsl:text>
                  </LineTotal>
                  <Delivery>
                    <PreferredDate>
                      <xsl:text>
2002-10-31
                      </xsl:text>
                    </PreferredDate>
                  </Delivery>
                  <Narrative>
                    <xsl:text>
As per our telephone conversation
                    </xsl:text>
                  </Narrative>
                </OrderLine>
                <OrderTotal>
                  <GoodsValue>
                    <xsl:text>
225.00
                    </xsl:text>
                  </GoodsValue>
                </OrderTotal>
              </Order>
            </xsl:for-each>
          </xsl:template>
        </xsl:stylesheet>
      </file>
    </files>
----------------------------------------------
Output and error from internet exploer
---------------------------------------------- 
 
<Order xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:schemas-basda-org:2000:purchaseOrder:xdr:3.01" xsi:schemaLocation="urn:schemas-basda-org:2000:purchaseOrder:xdr:3.01 order-v3.xsd                            urn:schemas-bossfed-co-uk:OP-Order-v1 OP-Order-v1.xsd">
        <OrderHead>
          <Schema>
            <Version>
3.05
            </Version>
          </Schema>
          <Parameters>
            <Language>
en-GB
            </Language>
            <DecimalSeparator>
.
            </DecimalSeparator>
            <Precision>
12.3
            </Precision>
          </Parameters>
          <OrderType Code="PUO">
Purchase Order
          </OrderType>
          <OrderCurrency>
            <Currency Code="GBP">
GB Pounds Sterling
            </Currency>
          </OrderCurrency>
          <Checksum></Checksum>
        </OrderHead>
        <OrderReferences>
          <ContractOrderReference>
1
          </ContractOrderReference>
          <BuyersOrderNumber Preserve="true">
PO123456
          </BuyersOrderNumber>
          <SuppliersOrderReference Preserve="true">
SO654321
          </SuppliersOrderReference>
        </OrderReferences>
        <OP:AdditionalOrderReferences xmlns:OP="urn:schemas-bossfed-co-uk:OP-Order-v1">
          <OP:OrderReference ReferenceDesc="Order Type">
            <OP:Reference>
PWD
            </OP:Reference>
          </OP:OrderReference>
        </OP:AdditionalOrderReferences>
        <OP:AdditionalOrderDates xmlns:OP="urn:schemas-bossfed-co-uk:OP-Order-v1">
          <OP:OrderDateTime DateTimeDesc="Earliest Time for Delivery">
10:30:00
          </OP:OrderDateTime>
          <OP:OrderDateTime DateTimeDesc="Latest Time for Delivery">
15:00:00
          </OP:OrderDateTime>
        </OP:AdditionalOrderDates>
        <OP:AdditionalOrderText xmlns:OP="urn:schemas-bossfed-co-uk:OP-Order-v1">
          <OP:OrderText TextDesc="Legal Information">
Terms and conditions are as specified in the contract
          </OP:OrderText>
        </OP:AdditionalOrderText>
        <OrderDate>
10am
        </OrderDate>
        <Supplier>
          <SupplierReferences>
            <BuyersCodeForSupplier>
M2358
            </BuyersCodeForSupplier>
            <GLN>
5012345654321
            </GLN>
          </SupplierReferences>
          <Party>
OfficeSpot Ltd.
          </Party>
          <Address>
            <Street>
5, Knockmitten Close
            </Street>
            <Street>
Western Industrial Estate
            </Street>
            <City>
Naas Road
            </City>
            <State>
Dublin
            </State>
            <PostCode>
12
            </PostCode>
            <Country Code="GB">
Ireland
            </Country>
          </Address>
        </Supplier>
        <Buyer>
          <BuyerReferences>
            <SuppliersCodeForBuyer>
BELLI
            </SuppliersCodeForBuyer>
            <GLN>
5012345678901
            </GLN>
          </BuyerReferences>
          <Party>
Scribe Stationers Ltd
          </Party>
          <Address>
            <Street>
Scribe House
            </Street>
            <Street>
Inkwell Road
            </Street>
            <City>
Manchester
            </City>
            <PostCode>
M12 3AB
            </PostCode>
            <Country Code="GB">
United Kingdom
            </Country>
          </Address>
          <Contact>
            <Name>
Peter Jones
            </Name>
            <Department>
Purchasing
            </Department>
            <DDI>
0161 234 5678
            </DDI>
            <Switchboard>
0161 234 5000
            </Switchboard>
            <Fax>
0161 235 7890
            </Fax>
          </Contact>
        </Buyer>
        <Delivery>
          <DeliverTo>
            <DeliverToReferences>
              <BuyersCodeForLocation>
LONGSIGHT
              </BuyersCodeForLocation>
            </DeliverToReferences>
            <Party>
Scribe Stationers - Longsight Depot
            </Party>
            <Address>
              <Street>
12-16 First Avenue
              </Street>
              <City>
Manchester
              </City>
              <PostCode>
M13 5OP
              </PostCode>
              <Country Code="GB">
United Kingdom
              </Country>
            </Address>
            <Contact>
              <Name>
Colin Davies
              </Name>
              <Department>
Goods Inward
              </Department>
              <DDI>
0161 357 9246
              </DDI>
              <Fax>
0161 357 9876
              </Fax>
            </Contact>
          </DeliverTo>
          <DeliverFrom>
            <DeliverFromReferences>
              <BuyersCodeForLocation>
DIRECT
              </BuyersCodeForLocation>
            </DeliverFromReferences>
            <Party>
Universal Manufacturing Limited
            </Party>
            <Contact>
              <Name>
Henry Wood
              </Name>
              <Department>
Despatch
              </Department>
              <DDI>
0121 0987 6543
              </DDI>
            </Contact>
          </DeliverFrom>
          <PreferredDate>
2002-11-01
          </PreferredDate>
        </Delivery>
        <InvoiceTo>
          <Party>
Scribe Stationers Ltd
          </Party>
          <Address>
            <Street>
Scribe House
            </Street>
            <Street>
Inkwell Road
            </Street>
            <City>
Manchesterv
            </City>
            <PostCode>
M12 3AB
            </PostCode>
            <Country Code="GB">
United Kingdom
            </Country>
          </Address>
          <Contact>
            <Name>
Matthew Smith
            </Name>
            <Department>
Accounts
            </Department>
            <DDI>
0161 234 5656
            </DDI>
            <Switchboard>
0161 234 5000
            </Switchboard>
          </Contact>
        </InvoiceTo>
        <OrderLine TypeDescription="Goods & Services" Action="Add" TypeCode="GDS">
          <LineNumber Preserve="true">
1
          </LineNumber>
          <OrderLineReferences>
            <ContractOrderReference>
C2002/0001
            </ContractOrderReference>
            <CostCentre>
CC02
            </CostCentre>
          </OrderLineReferences>
          <Product>
            <SuppliersProductCode>
3
            </SuppliersProductCode>
            <BuyersProductCode>
235623
            </BuyersProductCode>
            <TradedUnitCode>
5016192986730
            </TradedUnitCode>
            <ConsumerUnitCode>
5016192986741
            </ConsumerUnitCode>
            <Description>
A4 Conference folder (25 pack)
            </Description>
            <Properties>
              <Length UOMDescription="Centimetre" UOMCode="CMT">
0
              </Length>
              <Width UOMDescription="Centimetre" UOMCode="CMT">
0
              </Width>
              <Color>
Blue
              </Color>
            </Properties>
          </Product>
          <Quantity UOMDescription="Piece" UOMCode="PCE">
            <Packsize>
25
            </Packsize>
            <Amount>
50
            </Amount>
          </Quantity>
          <Price UOMDescription="Pack" UOMCode="PCK">
            <Units>
1
            </Units>
            <UnitPrice>
1.50
            </UnitPrice>
          </Price>
          <LineTotal>
75.00
          </LineTotal>
        </OrderLine>
        <OrderLine TypeDescription="Goods & Services" Action="Add" TypeCode="GDS">
          <LineNumber Preserve="true">
2
          </LineNumber>
          <OrderLineReferences>
            <ContractOrderReference>
C2002/0002
            </ContractOrderReference>
            <CostCentre>
CC03
            </CostCentre>
          </OrderLineReferences>
          <OP:AdditionalOrderLineReferences xmlns:OP="urn:schemas-bossfed-co-uk:OP-Order-v1">
            <OP:OrderLineReference ReferenceDesc="Back Order Flag">
              <OP:Reference>
Y
              </OP:Reference>
            </OP:OrderLineReference>
            <OP:OrderLineReference ReferenceDesc="Product Specification">
              <OP:Reference>
PS-1234321
              </OP:Reference>
              <OP:ReferenceDate>
2001-11-10
              </OP:ReferenceDate>
            </OP:OrderLineReference>
          </OP:AdditionalOrderLineReferences>
          <Product>
            <SuppliersProductCode>
181818
            </SuppliersProductCode>
            <BuyersProductCode>
SCR-27384
            </BuyersProductCode>
            <TradedUnitCode>
5016192986790
            </TradedUnitCode>
            <ConsumerUnitCode>
4074400410000
            </ConsumerUnitCode>
            <Description>
Tippex 30ml (tray of 20 bottles)
            </Description>
            <Properties>
              <Other Description="Pallet Percentage" UOMCode="PCT">
25
              </Other>
            </Properties>
          </Product>
          <Quantity UOMDescription="Pack" UOMCode="PCK">
            <Packsize>
20
            </Packsize>
            <Amount>
15
            </Amount>
          </Quantity>
          <Price UOMDescription="Pack" UOMCode="PCK">
            <UnitPrice>
10.00
            </UnitPrice>
          </Price>
          <LineTotal>
150.00
          </LineTotal>
          <Delivery>
            <PreferredDate>
2002-10-31
            </PreferredDate>
          </Delivery>
          <Narrative>
As per our telephone conversation
          </Narrative>
        </OrderLine>
        <OrderTotal>
          <GoodsValue>
225.00
          </GoodsValue>
        </OrderTotal>
      </Order>
----------------------------------------------------
 
The XML page cannot be displayed 
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. 
 
 
--------------------------------------------------------------------------------
 
Whitespace is not allowed at this location. Error processing resource 'file:///C:/Users/d/Downloads/OS100000002(2).xml'. L...
 
        <OrderLine TypeDescription="Goods & Services" Action="Add" TypeCode="GDS">
------------------------------...

Open in new window

0
DavidO84
Asked:
DavidO84
  • 5
  • 4
8 Solutions
 
abelCommented:
If you have a template you can only have it working with the xsl:stylesheet as the root element, which is not the case in your situation. Make the XSLT valid first, and then try to run it. Several XSLT editors are around that can help you in the process (oXygen, Eclipse, Visual Studio etc).
0
 
BigRatCommented:
Line 836 of the document contains an unescaped ampersand character in "Goods & Services", which should read "Goods &amp; Services". The same occurs on line 898.
0
 
abelCommented:
@BigRat: I'm under the impression that that's the output of the XML the way Internet Explorer sees it.

@OP: I looked a bit more at your code. Can you tell us how the code is instantiated? Is this a client side or a server side transform? The error that you get is seems to be about a location where whitespace is not allowed, which is for instance before the <?xml ?> prolog, but that does not seem to match the output you show above.

The XSLT as you show it is not valid. Can you show the XSLT the way it is called and the input for the XSLT? Is it possible that this is part of some data transformation service and this is the way you are supposed to hand it in to the data transformation service? Can you upload the exact source of the input, the output and XSLT (only the XSLT, not the elements around it which are not part of the XSLT)? Rename them to *.txt and use "Attach File".
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
BigRatCommented:
My comment pointed out two errors. The questioner said he got an error, was however unspecific.

angelIII: This is the third question in as many a day that I have had to object to "delete with no refund", although I have posted a comment refering to an error. Is this "delete no refund" an automatic posting?
0
 
BigRatCommented:
Last comment wrong posting - sorry!
0
 
abelCommented:
I agree, looking again at the original error, it is likely that BigRat is correct in his reading of the question: http:#24752641 however, the xslt is not correct either (http:#24753484). I'd settle with either BigRat's comment as answer or a split :-)

About the follow-up q. of BigRat: cleaning up is a hell of a task. The volunteers do their best to post the correct recommendation, but do not have time to read through all q&a, so when a q. is abandoned and it "looks like" it should be deleted, than that'll be the recommendation. This saves time on many questions that really ought to be deleted and others, like this one, will receive a follow up comment explaining what the correct closing should be.

-- Abel --
0
 
BigRatCommented:
abel: I don't disagree about cleaning up being a hell of a task. But answering the questions is as well. What concerns me is the seemingly automatic approach where we have to object to something which ought to be obvious. Perhaps a better way would be to post an automated administrative comment along the lines :-

no posters -> delete with refund
one poster -> accept that poster
more than one poster -> accept with split.

Then if there are no objections (primarily on behalf of the questioner), the actual review may or may not allocate the points fairly. I'd have absolutely no objection in having to split with somebody who did not contribute or contribute little. What I object to is to have to beg.
0
 
DavidO84Author Commented:
Apologies for the delay in replying, the template was in fact wrong i.e

<Order xsi:schemaLocation='urn:schemas-basda-org:2000:purchaseOrder:xdr:3.01 order-v3.xsd
                           urn:schemas-bossfed-co-uk:OP-Order-v1 OP-Order-v1.xsd'
       xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
       xmlns='urn:schemas-basda-org:2000:purchaseOrder:xdr:3.01'>

this section was not needed. I was handed an example of what the output file should look like and that is what i had posted on the this page.

Thank you to everyone who read this post and particpated.
0
 
abelCommented:
Hmm, that template snippet still has nothing to do with an XSLT template, instead, it's a normal XML (opening) tag. Any XSLT template will have to start with xsl:template or xsl:stylesheet as root element. If not, it is not a stylesheet (or it needs preprocessing)...

Anyway, glad you checked back, pity we couldn't help better and hope that your original issue is somehow resolved.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now