You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Tim Hibbs <tv...@fedex.com> on 2010/02/17 17:52:39 UTC

Output from node traversal not processing correctly

Hi - I'm requesting some basic assistance with an XSL processing
problem. I would think this is a simple issue to resolve, but I haven't
had much luck. 
Any asistance would be greatly appreciated.
 
Issue: Node contents not being output as expected.
 
Execution Context: 
    - eclipse 3.5.1, running a 2.x EJB on a local Weblogic 10.3 server,
using Java JRE jdk16.0_17
        - using eclipse Java EE Developer Tools, Oracle Weblogic Server
Tools, Oracle Common Tools
        - CLASSPATH overridden to force xalan.jar, xml-apis.jar,
serializer.jar, and xercesImpl.jar before weblogic.jar
            - to allow instantiation of a proper TransformerFactory (not
Weblogic's version) and use of the "debugger Interface"
(http://xml.apache.org/xalan-j/usagepatterns.html#debugging)
    - Xalan-j_2_7_1
    - Input is a DOMSource, wrapping an org.w3c.dom.Document.
        - Relevant code: aTransformer.transform(aDOMSource, new
StreamResult(aFileOutputStream)); "aTransformer" is instanceof
TransformerImpl
 
Personal Context:
    - New to XSL, Xalan. Have taken care to try all options I can think
of before soliciting for assistance here. Don't fully understand
Debugger outputs (below).
 
Anticipated Result:
<?xml version="1.0" encoding="UTF-8"?>
<html>
    <body>
       To:    John Customer
    </body>
</html>

Actual Result:
<?xml version="1.0" encoding="UTF-8"?><html>
<body>Customer Company123 Main StreetAnytownCO80134USJohn
CustomerFedex02/02/1012:01:003031234567John.Customer@customerco.com1
12345678Salt Lake CityUT84106US</body>
</html>
 
XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<tFreightRateQuotation
xmlns="http://www.fedex.com/schemas/freightRateQuotation">
   <AccountInformation>
      <CompanyName>Customer Company</CompanyName>
      <Address1>123 Main Street</Address1>
      <City>Anytown</City>
      <State>CO</State>
      <Postal>80134</Postal>
      <Country>US</Country>
   </AccountInformation>
   <CommonData>
      <To>John Customer</To>
      <From>Fedex</From>
      <HeaderDate>02/02/10</HeaderDate>
      <HeaderTime>12:01:00</HeaderTime>
      <FaxNumber>3031234567</FaxNumber>
      <EmailAddress>John.Customer@customerco.com</EmailAddress>
   </CommonData>
   <RateQuote>
      <QuoteNumber>1 12345678</QuoteNumber>
      <OriginAddress>
         <OriginCity>Salt Lake City</OriginCity>
         <OriginState>UT</OriginState>
         <OriginPostal>84106</OriginPostal>
         <OriginCountry>US</OriginCountry>
      </OriginAddress>
   </RateQuote>
</tFreightRateQuotation>

XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
        <html>
            <body>
                <xsl:apply-templates />
            </body>
        </html>
    </xsl:template>

    <xsl:template match="To">
            To: <xsl:value-of select="."/>
        <xsl:apply-templates/>
    </xsl:template>
</xsl:stylesheet>
 
Logging information (from "Debugger Interface",
http://xml.apache.org/xalan-j/usagepatterns.html#debugging
<http://xml.apache.org/xalan-j/usagepatterns.html#debugging> ):
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #3, Column #26: template match='/' 
STARTDOCUMENT
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #4, Column #9: html
STARTDOCUMENT
STARTELEMENT: html
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #5, Column #10: body
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #6, Column #29: apply-templates
Selected source node '#document'
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #6, Column #29: apply-templates, select='null': 
     10001: tFreightRateQuotation
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'tFreightRateQuotation'
(default rule) apply-templates, select='null': 
     10004: AccountInformation
     10011: CommonData
     1001e: RateQuote
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'AccountInformation'
(default rule) apply-templates, select='null': 
     10005: CompanyName
     10007: Address1
     10009: City
     1000b: State
     1000d: Postal
     1000f: Country
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'CompanyName'
(default rule) apply-templates, select='null': 
     10006: #text
STARTELEMENT: body
CHARACTERS: Customer Company
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'Address1'
(default rule) apply-templates, select='null': 
     10008: #text
CHARACTERS: 123 Main Street
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'City'
(default rule) apply-templates, select='null': 
     1000a: #text
CHARACTERS: Anytown
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'State'
(default rule) apply-templates, select='null': 
     1000c: #text
CHARACTERS: CO
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'Postal'
(default rule) apply-templates, select='null': 
     1000e: #text
CHARACTERS: 80134
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'Country'
(default rule) apply-templates, select='null': 
     10010: #text
CHARACTERS: US
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'CommonData'
(default rule) apply-templates, select='null': 
     10012: To
     10014: From
     10016: HeaderDate
     10018: HeaderTime
     1001a: FaxNumber
     1001c: EmailAddress
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'To'
(default rule) apply-templates, select='null': 
     10013: #text
CHARACTERS: John Customer
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'From'
(default rule) apply-templates, select='null': 
     10015: #text
CHARACTERS: Fedex
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'HeaderDate'
(default rule) apply-templates, select='null': 
     10017: #text
CHARACTERS: 02/02/10
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'HeaderTime'
(default rule) apply-templates, select='null': 
     10019: #text
CHARACTERS: 12:01:00
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'FaxNumber'
(default rule) apply-templates, select='null': 
     1001b: #text
CHARACTERS: 3031234567
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'EmailAddress'
(default rule) apply-templates, select='null': 
     1001d: #text
CHARACTERS: John.Customer@customerco.com
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'RateQuote'
(default rule) apply-templates, select='null': 
     1001f: QuoteNumber
     10021: OriginAddress
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'QuoteNumber'
(default rule) apply-templates, select='null': 
     10020: #text
CHARACTERS: 1 12345678
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'OriginAddress'
(default rule) apply-templates, select='null': 
     10022: OriginCity
     10024: OriginState
     10026: OriginPostal
     10028: OriginCountry
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'OriginCity'
(default rule) apply-templates, select='null': 
     10023: #text
CHARACTERS: Salt Lake City
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'OriginState'
(default rule) apply-templates, select='null': 
     10025: #text
CHARACTERS: UT
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'OriginPostal'
(default rule) apply-templates, select='null': 
     10027: #text
CHARACTERS: 84106
null Line #0, Column #0: template match='*' 
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
Selected source node 'OriginCountry'
(default rule) apply-templates, select='null': 
     10029: #text
CHARACTERS: US
ENDELEMENT: body
ENDELEMENT: html
ENDDOCUMENT
 
Observations:
    - Nodes seem to be traversed properly.
    - Line # and Column # don't increment after initial apply-templates
 
Thanks in advance for your insights!

Tim Hibbs
FedEx Services
350 Spectrum Loop
Colorado Springs, CO 80921
719-484-2131

 

Re: Output from node traversal not processing correctly

Posted by Michael Ludwig <mi...@gmx.de>.
Tim Hibbs schrieb am 17.02.2010 um 16:52:12 (-0600):
> Michael,
> 
> Many thanks for the feedback.

Tim,

you're very welcome.

> Prior to my solicitation for help from this group, I'd read through
> (but not fully understood) the book "Definitive XSLT and Xpath" by G.
> Ken Holman.

Ken Holman also highly recommended.

> I'm not really clear WHY we need a namespace for the project I'm
> working on, so I'll soon be trying to process without a namespace
> specifier to see if that makes things easier to work with.

Quite often, namespaces aren't really needed, but people will still put
them there because that looks professional. And in the end it maybe is.
Anyway, namespaces aren't terribly complicated for the user, so my
advice is to just accept their existence and get used to them.

> I will take your advice and review the built-in template rules (Nathan
> also provided some useful information on that in one of our exchanges)
> as well as the identity template. I'm not sure what the latter is at
> this point, as I don't recall seeing that phrase before.

  <xsl:template match="@*|node()"><!-- identity template -->
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

This is it. It matches everything and copies everything. The usefulness
of this comes to bear when you want to make small modifications to a
document. Say, filter out all <odd> elements, or take away bla/@blub
attributes. You can then define exceptions:

  <xsl:template match="odd | bla/@blub"/><!-- just drop them -->

Or skipping the element while continuing to process the children:

  <xsl:template match="odd">
    <xsl:apply-templates/>
  </xsl:template>

-- 
Michael Ludwig

RE: Output from node traversal not processing correctly

Posted by Tim Hibbs <tv...@fedex.com>.
Michael,

Many thanks for the feedback.

Prior to my solicitation for help from this group, I'd read through (but not fully understood) the book "Definitive XSLT and Xpath" by G. Ken Holman. I also went through both the XSLT and Xpath tutorials from http://www.w3cschools.com. I THOUGHT I had enough information to proceed; however, it's obvious that I missed some critical nuances of namespaces and Xpath syntax that kept my XSL from being processed correctly. I'll take a look at the books you've suggested as additional resources.

I've had a small interchange with Nathan Nadeau about the namespace issue (and we've copied the list recipients on this interchange), which you've also defined as something I have been doing incorrectly. I'm not really clear WHY we need a namespace for the project I'm working on, so I'll soon be trying to process without a namespace specifier to see if that makes things easier to work with.

In response to Nathan's feedback, and your confirmation below, I made similar changes and re-ran my process. I'm very pleased to report that it worked, and I think I have enough information at this point to proceed further in some sort of rudimentary way.

I will take your advice and review the built-in template rules (Nathan also provided some useful information on that in one of our exchanges) as well as the identity template. I'm not sure what the latter is at this point, as I don't recall seeing that phrase before.

I sincerely appreciate the time you and Nathan have taken out of your day to assist. I hope I'll be able to return the favor soon.


Tim Hibbs
FedEx Services
350 Spectrum Loop
Colorado Springs, CO 80921
719-484-2131


-----Original Message-----
From: Michael Ludwig [mailto:milu71@gmx.de] 
Sent: Wednesday, February 17, 2010 3:04 PM
To: Xalan-J Users
Subject: Re: Output from node traversal not processing correctly

Tim Hibbs schrieb am 17.02.2010 um 10:52:39 (-0600):

> Personal Context:
>     - New to XSL, Xalan. Have taken care to try all options I can 
> think of before soliciting for assistance here. Don't fully understand 
> Debugger outputs (below).

I'd consider reading a good introductory tutorial or even a book.
Recommended teachers include:

* Michael Kay
* Jeni Tennison
* Evan Lenz

You should be able to locate books and tutorials.

> <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
> <tFreightRateQuotation 
> xmlns="http://www.fedex.com/schemas/freightRateQuotation">

Namespace declared and used!

> <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

No namepace declared :-(

>     <xsl:template match="/">
>         <html>
>             <body>
>                 <xsl:apply-templates />

You need to put a suitable XPath here, else too much output.

>     <xsl:template match="To">
>             To: <xsl:value-of select="."/>
>         <xsl:apply-templates/>
>     </xsl:template>

Two items you absolutely want to learn about at the beginning:

* built-in template rules
* identity template (very common coding pattern)

> Logging information (from "Debugger Interface",

Don't worry about debugging yet.

Here's a working example:

C:\cygwin\tmp :: more /t2 tim.xsl
<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0"
  xmlns:frq="http://www.fedex.com/schemas/freightRateQuotation"
  exclude-result-prefixes="frq"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="html" indent="yes"/>

  <xsl:template match="/">
    <html>
      <body>
        <div>
          <xsl:apply-templates select="*/frq:CommonData/frq:To"/>
        </div>
      </body>
    </html>
  </xsl:template>

  <xsl:template match="frq:To"> To: <xsl:value-of select="."/>
  </xsl:template>

</xsl:stylesheet>

C:\cygwin\tmp :: xalan tim.xml tim.xsl
<html>
<body>
<div> To: John Customer</div>
</body>
</html>

Best,
--
Michael Ludwig

Re: Output from node traversal not processing correctly

Posted by Michael Ludwig <mi...@gmx.de>.
Tim Hibbs schrieb am 17.02.2010 um 10:52:39 (-0600):

> Personal Context:
>     - New to XSL, Xalan. Have taken care to try all options I can think
> of before soliciting for assistance here. Don't fully understand
> Debugger outputs (below).

I'd consider reading a good introductory tutorial or even a book.
Recommended teachers include:

* Michael Kay
* Jeni Tennison
* Evan Lenz

You should be able to locate books and tutorials.

> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <tFreightRateQuotation
> xmlns="http://www.fedex.com/schemas/freightRateQuotation">

Namespace declared and used!

> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

No namepace declared :-(

>     <xsl:template match="/">
>         <html>
>             <body>
>                 <xsl:apply-templates />

You need to put a suitable XPath here, else too much output.

>     <xsl:template match="To">
>             To: <xsl:value-of select="."/>
>         <xsl:apply-templates/>
>     </xsl:template>

Two items you absolutely want to learn about at the beginning:

* built-in template rules
* identity template (very common coding pattern)

> Logging information (from "Debugger Interface",

Don't worry about debugging yet.

Here's a working example:

C:\cygwin\tmp :: more /t2 tim.xsl
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
  xmlns:frq="http://www.fedex.com/schemas/freightRateQuotation"
  exclude-result-prefixes="frq"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="html" indent="yes"/>

  <xsl:template match="/">
    <html>
      <body>
        <div>
          <xsl:apply-templates select="*/frq:CommonData/frq:To"/>
        </div>
      </body>
    </html>
  </xsl:template>

  <xsl:template match="frq:To"> To: <xsl:value-of select="."/>
  </xsl:template>

</xsl:stylesheet>

C:\cygwin\tmp :: xalan tim.xml tim.xsl
<html>
<body>
<div> To: John Customer</div>
</body>
</html>

Best,
-- 
Michael Ludwig

Re: Output from node traversal not processing correctly

Posted by Nathan Nadeau <nd...@gleim.com>.
Tim Hibbs wrote:
> Second, with changes you implied in your response, I tried several 
> variations. I'm still missing something, probably elemental, of 
> importance. Additional guidance would be most welcome... 
>  
> I now have the following, representative of all the variations I tried:
> *_XML_*: (no change)
>  
> *_XSL_*:
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
> xmlns="http://www.fedex.com/schemas/freightRateQuotation">
>  <xsl:template match="/">
>   <html>
>    <body>
>      <xsl:apply-templates select="To" />
>    </body>
>   </html>
>  </xsl:template>
>  
>  <xsl:template match="To">
>   To: <xsl:value-of select="."/>
>  </xsl:template>
> </xsl:stylesheet>
>  
You have two issues now that I can see:

1) Declaring the default namespace using xmlns="xyz" in your XSL does 
not actually affect element names listed in XPath expressions (the 
select="To" in your <xsl:apply-templates> is an XPath expression). If an 
element in an XPath expression does not have an explicit namespace 
prefix, XPath assumes the null namespace, NOT the default namespace. 
Therefore it is not finding any null namespace <To> elements in your 
input XML, since your XML only contains <To> elements in the 
http://www.fedex.com/schemas/freightRateQuotation namespace.

You need to use an explicit namespace declaration in your XSL such as 
xmlns:fedex="http://www.fedex.com/schemas/freightRateQuotation", and 
then use <xsl:apply-templates select="fedex:To"/> and <xsl:template 
match="fedex:To">

2) The XPath you're using in the <apply-templates/> statement actually 
will not find the <To> element in your XML. This is because select="To" 
is equivalent to select="child::To", which means you're telling it to 
look for children elements of the current context node named <To>. 
However your current context node is the document itself because you're 
in the match="/" template. There are no direct children <To> elements 
for the location you're at in your input document. You need to fix your 
XPath so that it can find the elements you want, or alter your context 
node so that it does contain the <To> element as a child.

For example you could use select="//fedex:To" or 
select="descendant::fedex:To" or 
select="fedex:tFreightRateQuotation/fedex:CommonData/fedex:To".

Good Luck,
Nathan

RE: Output from node traversal not processing correctly

Posted by Tim Hibbs <tv...@fedex.com>.
Nathan,
 
Thanks so much for the insights; not quite there yet in my
understanding...
 
First things first - xalan-j-users list protocol: It appears my
deficiency relates to general XSLT knowledge. Is it appropriate to copy
the list on any follow-up questions here, even though they may not
directly relate to xalan? I'm doing so this time under the presumption
the answer is "Yes", but I also don't want to pollute inboxes with
chaff. On the other hand, I want to ensure that those who might benefit
from the exchange can do so. 
 
Second, with changes you implied in your response, I tried several
variations. I'm still missing something, probably elemental, of
importance. Additional guidance would be most welcome...
 
I now have the following, representative of all the variations I tried:

XML: (no change)
 
XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.fedex.com/schemas/freightRateQuotation">
 <xsl:template match="/">
  <html>
   <body>
     <xsl:apply-templates select="To" />
   </body>
  </html>
 </xsl:template>
 
 <xsl:template match="To">
  To: <xsl:value-of select="."/>
 </xsl:template>
</xsl:stylesheet>
 
Actual Result:
<?xml version="1.0" encoding="UTF-8"?><html
xmlns="http://www.fedex.com/schemas/freightRateQuotation"><body/></html>
 
Logging information (from "Debugger Interface":
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #3, Column #26: template match='/' 
STARTDOCUMENT
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #4, Column #9: html
STARTELEMENT: html
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #5, Column #10: body
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #6, Column #41: apply-templates
Selected source node '#document'
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #6, Column #41: apply-templates, select='null': 
     [empty node list]
STARTELEMENT: body
ENDELEMENT: body
ENDELEMENT: html
ENDDOCUMENT
 
Thanks in advance for the consideration and attention.

Tim Hibbs
FedEx Services
350 Spectrum Loop
Colorado Springs, CO 80921
719-484-2131

 

________________________________

From: Nathan Nadeau [mailto:ndn@gleim.com] 
Sent: Wednesday, February 17, 2010 10:16 AM
To: Tim Hibbs
Cc: xalan-j-users@xml.apache.org
Subject: Re: Output from node traversal not processing correctly


Tim,

What's happening is you're triggering the default templates that are
provided by the XSLT processor that match element and text  nodes when
you call <xsl:apply-templates/>. There are built in rules provided by
the XSLT processor that match the different node types. The default rule
for element nodes is to simply call <xsl:apply-templates/> again on its
children nodes. The default rule for a text node is to print out the
text to the output.

So when you call <xsl:apply-templates/> in your XSL, it's actually
matching all the nodes, not just the <To> element, and it's firing the
default template for everything but the <To> element, which fires the
more specific template that matches the <To> element. This has the
effect of printing out out all the text of each of the elements.

And actually it looks like it might not be matching the <To> element
either, because it has a namespace in the source XML document that
you're not specifying in your XSL. Your namespaces need to match between
your XSL and your input XML document, otherwise the processor will not
match it.

Nathan Nadeau

Tim Hibbs wrote: 

	Hi - I'm requesting some basic assistance with an XSL processing
problem. I would think this is a simple issue to resolve, but I haven't
had much luck. 
	Any asistance would be greatly appreciated.
	 
	Issue: Node contents not being output as expected.
	 
	Execution Context: 
	    - eclipse 3.5.1, running a 2.x EJB on a local Weblogic 10.3
server, using Java JRE jdk16.0_17
	        - using eclipse Java EE Developer Tools, Oracle Weblogic
Server Tools, Oracle Common Tools
	        - CLASSPATH overridden to force xalan.jar, xml-apis.jar,
serializer.jar, and xercesImpl.jar before weblogic.jar
	            - to allow instantiation of a proper
TransformerFactory (not Weblogic's version) and use of the "debugger
Interface" (http://xml.apache.org/xalan-j/usagepatterns.html#debugging)
	    - Xalan-j_2_7_1
	    - Input is a DOMSource, wrapping an org.w3c.dom.Document.
	        - Relevant code: aTransformer.transform(aDOMSource, new
StreamResult(aFileOutputStream)); "aTransformer" is instanceof
TransformerImpl
	 
	Personal Context:
	    - New to XSL, Xalan. Have taken care to try all options I
can think of before soliciting for assistance here. Don't fully
understand Debugger outputs (below).
	 
	Anticipated Result:
	<?xml version="1.0" encoding="UTF-8"?>
	<html>
	    <body>
	       To:    John Customer
	    </body>
	</html>
	
	Actual Result:
	<?xml version="1.0" encoding="UTF-8"?><html>
	<body>Customer Company123 Main StreetAnytownCO80134USJohn
CustomerFedex02/02/1012:01:003031234567John.Customer@customerco.com1
12345678Salt Lake CityUT84106US</body>
	</html>
	 
	XML:
	<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
	<tFreightRateQuotation
xmlns="http://www.fedex.com/schemas/freightRateQuotation">
	   <AccountInformation>
	      <CompanyName>Customer Company</CompanyName>
	      <Address1>123 Main Street</Address1>
	      <City>Anytown</City>
	      <State>CO</State>
	      <Postal>80134</Postal>
	      <Country>US</Country>
	   </AccountInformation>
	   <CommonData>
	      <To>John Customer</To>
	      <From>Fedex</From>
	      <HeaderDate>02/02/10</HeaderDate>
	      <HeaderTime>12:01:00</HeaderTime>
	      <FaxNumber>3031234567</FaxNumber>
	      <EmailAddress>John.Customer@customerco.com</EmailAddress>
	   </CommonData>
	   <RateQuote>
	      <QuoteNumber>1 12345678</QuoteNumber>
	      <OriginAddress>
	         <OriginCity>Salt Lake City</OriginCity>
	         <OriginState>UT</OriginState>
	         <OriginPostal>84106</OriginPostal>
	         <OriginCountry>US</OriginCountry>
	      </OriginAddress>
	   </RateQuote>
	</tFreightRateQuotation>
	
	XSL:
	<?xml version="1.0" encoding="UTF-8"?>
	<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	    <xsl:template match="/">
	        <html>
	            <body>
	                <xsl:apply-templates />
	            </body>
	        </html>
	    </xsl:template>
	
	    <xsl:template match="To">
	            To: <xsl:value-of select="."/>
	        <xsl:apply-templates/>
	    </xsl:template>
	</xsl:stylesheet>
	 
	Logging information (from "Debugger Interface",
http://xml.apache.org/xalan-j/usagepatterns.html#debugging
<http://xml.apache.org/xalan-j/usagepatterns.html#debugging> ):
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #3, Column #26: template match='/' 
	STARTDOCUMENT
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #4, Column #9: html
	STARTDOCUMENT
	STARTELEMENT: html
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #5, Column #10: body
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #6, Column #29: apply-templates
	Selected source node '#document'
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #6, Column #29: apply-templates, select='null': 
	     10001: tFreightRateQuotation
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'tFreightRateQuotation'
	(default rule) apply-templates, select='null': 
	     10004: AccountInformation
	     10011: CommonData
	     1001e: RateQuote
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'AccountInformation'
	(default rule) apply-templates, select='null': 
	     10005: CompanyName
	     10007: Address1
	     10009: City
	     1000b: State
	     1000d: Postal
	     1000f: Country
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'CompanyName'
	(default rule) apply-templates, select='null': 
	     10006: #text
	STARTELEMENT: body
	CHARACTERS: Customer Company
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'Address1'
	(default rule) apply-templates, select='null': 
	     10008: #text
	CHARACTERS: 123 Main Street
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'City'
	(default rule) apply-templates, select='null': 
	     1000a: #text
	CHARACTERS: Anytown
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'State'
	(default rule) apply-templates, select='null': 
	     1000c: #text
	CHARACTERS: CO
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'Postal'
	(default rule) apply-templates, select='null': 
	     1000e: #text
	CHARACTERS: 80134
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'Country'
	(default rule) apply-templates, select='null': 
	     10010: #text
	CHARACTERS: US
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'CommonData'
	(default rule) apply-templates, select='null': 
	     10012: To
	     10014: From
	     10016: HeaderDate
	     10018: HeaderTime
	     1001a: FaxNumber
	     1001c: EmailAddress
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'To'
	(default rule) apply-templates, select='null': 
	     10013: #text
	CHARACTERS: John Customer
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'From'
	(default rule) apply-templates, select='null': 
	     10015: #text
	CHARACTERS: Fedex
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'HeaderDate'
	(default rule) apply-templates, select='null': 
	     10017: #text
	CHARACTERS: 02/02/10
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'HeaderTime'
	(default rule) apply-templates, select='null': 
	     10019: #text
	CHARACTERS: 12:01:00
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'FaxNumber'
	(default rule) apply-templates, select='null': 
	     1001b: #text
	CHARACTERS: 3031234567
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'EmailAddress'
	(default rule) apply-templates, select='null': 
	     1001d: #text
	CHARACTERS: John.Customer@customerco.com
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'RateQuote'
	(default rule) apply-templates, select='null': 
	     1001f: QuoteNumber
	     10021: OriginAddress
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'QuoteNumber'
	(default rule) apply-templates, select='null': 
	     10020: #text
	CHARACTERS: 1 12345678
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'OriginAddress'
	(default rule) apply-templates, select='null': 
	     10022: OriginCity
	     10024: OriginState
	     10026: OriginPostal
	     10028: OriginCountry
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'OriginCity'
	(default rule) apply-templates, select='null': 
	     10023: #text
	CHARACTERS: Salt Lake City
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'OriginState'
	(default rule) apply-templates, select='null': 
	     10025: #text
	CHARACTERS: UT
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'OriginPostal'
	(default rule) apply-templates, select='null': 
	     10027: #text
	CHARACTERS: 84106
	null Line #0, Column #0: template match='*' 
	
file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXm
lToPdf-FO.xsl Line #0, Column #0: apply-templates
	Selected source node 'OriginCountry'
	(default rule) apply-templates, select='null': 
	     10029: #text
	CHARACTERS: US
	ENDELEMENT: body
	ENDELEMENT: html
	ENDDOCUMENT
	 
	Observations:
	    - Nodes seem to be traversed properly.
	    - Line # and Column # don't increment after initial
apply-templates
	 
	Thanks in advance for your insights!

	Tim Hibbs
	FedEx Services
	350 Spectrum Loop
	Colorado Springs, CO 80921
	719-484-2131

	 


-- 
Nathan Nadeau
ndn@gleim.com
Software Development
Gleim Publications, Inc.
http://www.gleim.com

Re: Output from node traversal not processing correctly

Posted by Nathan Nadeau <nd...@gleim.com>.
Tim,

What's happening is you're triggering the default templates that are 
provided by the XSLT processor that match element and text  nodes when 
you call <xsl:apply-templates/>. There are built in rules provided by 
the XSLT processor that match the different node types. The default rule 
for element nodes is to simply call <xsl:apply-templates/> again on its 
children nodes. The default rule for a text node is to print out the 
text to the output.

So when you call <xsl:apply-templates/> in your XSL, it's actually 
matching all the nodes, not just the <To> element, and it's firing the 
default template for everything but the <To> element, which fires the 
more specific template that matches the <To> element. This has the 
effect of printing out out all the text of each of the elements.

And actually it looks like it might not be matching the <To> element 
either, because it has a namespace in the source XML document that 
you're not specifying in your XSL. Your namespaces need to match between 
your XSL and your input XML document, otherwise the processor will not 
match it.

Nathan Nadeau

Tim Hibbs wrote:
> Hi - I'm requesting some basic assistance with an XSL processing 
> problem. I would think this is a simple issue to resolve, but I 
> haven't had much luck.
> Any asistance would be greatly appreciated.
>  
> *_Issue_*: Node contents not being output as expected.
>  
> *_Execution Context_*: 
>     - eclipse 3.5.1, running a 2.x EJB on a local Weblogic 10.3 
> server, using Java JRE jdk16.0_17
>         - using eclipse Java EE Developer Tools, Oracle Weblogic 
> Server Tools, Oracle Common Tools
>         - CLASSPATH overridden to force xalan.jar, xml-apis.jar, 
> serializer.jar, and xercesImpl.jar before weblogic.jar
>             - to allow instantiation of a proper TransformerFactory 
> (not Weblogic's version) and use of the "debugger Interface" 
> (http://xml.apache.org/xalan-j/usagepatterns.html#debugging)
>     - Xalan-j_2_7_1
>     - Input is a */DOMSource/*, wrapping an org.w3c.dom.Document.
>         - Relevant code: aTransformer.transform(aDOMSource, *new* 
> StreamResult(aFileOutputStream)); "aTransformer" is instanceof 
> TransformerImpl
>  
> *_Personal Context_*:
>     - New to XSL, Xalan. Have taken care to try all options I can 
> think of before soliciting for assistance here. Don't fully understand 
> Debugger outputs (below).
>  
> *_Anticipated Result_*:
> <?xml version="1.0" encoding="UTF-8"?>
> <html>
>     <body>
>        To:    John Customer
>     </body>
> </html>
> *_Actual Result_*:
> <?xml version="1.0" encoding="UTF-8"?><html>
> <body>Customer Company123 Main StreetAnytownCO80134USJohn 
> CustomerFedex02/02/1012:01:003031234567John.Customer@customerco.com1 
> 12345678Salt Lake CityUT84106US</body>
> </html>
>  
> *_XML_*:
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <tFreightRateQuotation 
> xmlns="http://www.fedex.com/schemas/freightRateQuotation">
>    <AccountInformation>
>       <CompanyName>Customer Company</CompanyName>
>       <Address1>123 Main Street</Address1>
>       <City>Anytown</City>
>       <State>CO</State>
>       <Postal>80134</Postal>
>       <Country>US</Country>
>    </AccountInformation>
>    <CommonData>
>       <To>John Customer</To>
>       <From>Fedex</From>
>       <HeaderDate>02/02/10</HeaderDate>
>       <HeaderTime>12:01:00</HeaderTime>
>       <FaxNumber>3031234567</FaxNumber>
>       <EmailAddress>John.Customer@customerco.com</EmailAddress>
>    </CommonData>
>    <RateQuote>
>       <QuoteNumber>1 12345678</QuoteNumber>
>       <OriginAddress>
>          <OriginCity>Salt Lake City</OriginCity>
>          <OriginState>UT</OriginState>
>          <OriginPostal>84106</OriginPostal>
>          <OriginCountry>US</OriginCountry>
>       </OriginAddress>
>    </RateQuote>
> </tFreightRateQuotation>
> *_XSL_*:
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>     <xsl:template match="/">
>         <html>
>             <body>
>                 <xsl:apply-templates />
>             </body>
>         </html>
>     </xsl:template>
>
>     <xsl:template match="To">
>             To: <xsl:value-of select="."/>
>         <xsl:apply-templates/>
>     </xsl:template>
> </xsl:stylesheet>
>  
> *_Logging information (from "Debugger Interface", 
> _**http://xml.apache.org/xalan-j/usagepatterns.html#debugging**_)_*:
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #3, Column #26: template match='/'
> STARTDOCUMENT
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #4, Column #9: html
> STARTDOCUMENT
> STARTELEMENT: html
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #5, Column #10: body
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #6, Column #29: apply-templates
> Selected source node '#document'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #6, Column #29: apply-templates, select='null':
>      10001: tFreightRateQuotation
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'tFreightRateQuotation'
> (default rule) apply-templates, select='null':
>      10004: AccountInformation
>      10011: CommonData
>      1001e: RateQuote
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'AccountInformation'
> (default rule) apply-templates, select='null':
>      10005: CompanyName
>      10007: Address1
>      10009: City
>      1000b: State
>      1000d: Postal
>      1000f: Country
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'CompanyName'
> (default rule) apply-templates, select='null':
>      10006: #text
> STARTELEMENT: body
> CHARACTERS: Customer Company
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'Address1'
> (default rule) apply-templates, select='null':
>      10008: #text
> CHARACTERS: 123 Main Street
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'City'
> (default rule) apply-templates, select='null':
>      1000a: #text
> CHARACTERS: Anytown
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'State'
> (default rule) apply-templates, select='null':
>      1000c: #text
> CHARACTERS: CO
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'Postal'
> (default rule) apply-templates, select='null':
>      1000e: #text
> CHARACTERS: 80134
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'Country'
> (default rule) apply-templates, select='null':
>      10010: #text
> CHARACTERS: US
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'CommonData'
> (default rule) apply-templates, select='null':
>      10012: To
>      10014: From
>      10016: HeaderDate
>      10018: HeaderTime
>      1001a: FaxNumber
>      1001c: EmailAddress
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'To'
> (default rule) apply-templates, select='null':
>      10013: #text
> CHARACTERS: John Customer
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'From'
> (default rule) apply-templates, select='null':
>      10015: #text
> CHARACTERS: Fedex
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'HeaderDate'
> (default rule) apply-templates, select='null':
>      10017: #text
> CHARACTERS: 02/02/10
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'HeaderTime'
> (default rule) apply-templates, select='null':
>      10019: #text
> CHARACTERS: 12:01:00
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'FaxNumber'
> (default rule) apply-templates, select='null':
>      1001b: #text
> CHARACTERS: 3031234567
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'EmailAddress'
> (default rule) apply-templates, select='null':
>      1001d: #text
> CHARACTERS: John.Customer@customerco.com 
> <ma...@customerco.com>
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'RateQuote'
> (default rule) apply-templates, select='null':
>      1001f: QuoteNumber
>      10021: OriginAddress
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'QuoteNumber'
> (default rule) apply-templates, select='null':
>      10020: #text
> CHARACTERS: 1 12345678
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'OriginAddress'
> (default rule) apply-templates, select='null':
>      10022: OriginCity
>      10024: OriginState
>      10026: OriginPostal
>      10028: OriginCountry
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'OriginCity'
> (default rule) apply-templates, select='null':
>      10023: #text
> CHARACTERS: Salt Lake City
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'OriginState'
> (default rule) apply-templates, select='null':
>      10025: #text
> CHARACTERS: UT
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'OriginPostal'
> (default rule) apply-templates, select='null':
>      10027: #text
> CHARACTERS: 84106
> null Line #0, Column #0: template match='*'
> file:///D:/workspaces/3.5/2010-June-load/1SRC_FAX/FaxEjb/XML/rateQuoteXmlToPdf-FO.xsl 
> Line #0, Column #0: apply-templates
> Selected source node 'OriginCountry'
> (default rule) apply-templates, select='null':
>      10029: #text
> CHARACTERS: US
> ENDELEMENT: body
> ENDELEMENT: html
> ENDDOCUMENT
>  
> *_Observations_*:
>     - Nodes seem to be traversed properly.
>     - Line # and Column # don't increment after initial apply-templates
>  
> Thanks in advance for your insights!
>
> /*Tim Hibbs*/*/
> /*FedEx Services
> 350 Spectrum Loop
> Colorado Springs, CO 80921
> 719-484-2131
>
>  

-- 
Nathan Nadeau
ndn@gleim.com
Software Development
Gleim Publications, Inc.
http://www.gleim.com