xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Toren <Rich...@Netprox.com>
Subject RE: Text output from xalan
Date Wed, 14 Feb 2001 08:23:24 GMT
Hello,
   This is curious.  From xml-spy the output for your files is:
<html><body><H1>Firmenname</H1>FirmenzusatzAnredeVornameNachnamePosition<h4>
</h4>StrasseNummerLandPLZOrtPostfachLandPLZOrt
Postfach<H4>Kommunikation:</H4>000044556600004456789emailwww</body></html>

I think, but I'm not sure that xml-spy is using msxml 3.0 (and the output is
the same).  Using the SimpleTransform example from the xalan-j_2_0_0 is all
wrong.  My first guess would be to check to see if my is the result of not
having a dtd (although I removed that reference).  Didn't someone mention a
problem with xerces?  I checked the file with an identity transformation

<xsl:template match="adresse">
   <xsl:copy-of select="." />
<xsl:template>

and received an empty file with xalan (it worked with msxml 3.0).  My guess
is that there is a problem parsing the file, although that doesn't explain
why my output from xalan differs from yours.  Might be worth trying other
XSLT processors.

Good luck,

Richard

-----Original Message-----
From: Matthias Teege [mailto:matthias@mteege.de]
Sent: Wednesday, February 14, 2001 8:52 AM
To: general@xml.apache.org
Subject: Re: Text output from xalan


Scott_Boag@lotus.com writes:

> Matthias, your best bet to get these questions answered is to send me
> sample input, a sample stylesheet, and details about what Xalan is doing
> that you don't like.  From your note it's a little hard to tell exactly
> what is going on, and what the solution is.

Ok, here the examples

XML File:

-- schnipp --

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE adresse SYSTEM "adresse.dtd">
<adresse>
  <firma>
    <firmenname>Firmenname</firmenname>
    <firmenzusatz>Firmenzusatz</firmenzusatz>
    <kontakt>
      <person>
	<anrede>Anrede</anrede>
	<vorname>Vorname</vorname>
	<nachname>Nachname</nachname>
      </person>
      <position>Position</position>
    </kontakt>
  </firma>
  <anschrift>
    <haus>
      <strasse>
	<strassenname>Strasse</strassenname>
	<hausnummer>Nummer</hausnummer>
      </strasse>
      <ort>
	<land>Land</land>
	<plz>PLZ</plz>
	<ortsname>Ort</ortsname>
      </ort>
    </haus>
    <post>
      <postfach>Postfach</postfach>
      <ort>
	<land>Land</land>
	<plz>PLZ</plz>
	<ortsname>Ort Postfach</ortsname>
      </ort>
    </post>
  </anschrift>
 <kommunikation>
    <fon typ="mobil">
      <vorwahl>0000</vorwahl>
      <nummer>445566</nummer>
    </fon>
    <fon typ="telefax">
      <vorwahl>0000</vorwahl>
      <nummer>4456789</nummer>
    </fon>
    <email>email</email>
    <www>www</www>
  </kommunikation>
</adresse>

-- schnapp --

XSL Sheet (only for testing, not completed)

-- schnipp --

<?xml version="1.0"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
  <xsl:output method="html" indent="no"/>

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

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

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

<xsl:template match="anschrift">
<h4>
 <xsl:choose>
  <xsl:when test="@typ='haus'">
   <xsl:text>Hausanschrift:</xsl:text>
  </xsl:when>
 <xsl:when test="@typ='post'">
   <xsl:text>Postanschrift:</xsl:text>
  </xsl:when>
</xsl:choose>
</h4>
<xsl:apply-templates/>
</xsl:template>
  
<xsl:template match="kommunikation">
<H4>
   <xsl:text>Kommunikation:</xsl:text>
</H4>
 <xsl:apply-templates/>
</xsl:template>

</xsl:stylesheet>

-- schnapp --

This all gives me (a lot of empty lines, tabs and spaces I
didnt want):

-- schnipp --

  
    Firmenname\\

    Firmenzusatz\\

    
      
	Anrede
	Vorname
	Nachname
      
      Position
    
  
  Postanschrift verwenden
 
    
      0000
      445566
    
    
      0000
      4456789
    
    email
    www
  

-- schnapp --

But I want this (without empty lines, tabs and spaces):

-- schnipp --

Firmenname\\
Firmenzusatz\\
Anrede
Vorname
Nachname
Position
...

-- schnapp --

Many thanks,
Matthias

-- 
Matthias Teege -- matthias@mteege.de -- http://emugs.de
make world not war
PGP-Key auf Anfrage

---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org

Mime
View raw message