xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] XML apparently cannot be used for general text markup: whitespace gripe


Subject: [xsl] XML apparently cannot be used for general text markup: whitespace gripe
From: "Chad Jones" <chad@xxxxxxxxxxxxxx>
Date: Tue, 19 Mar 2002 16:06:29 +0200

Hi there,

 I've noticed a lot of xml-derived web pages out there have screwed up
whitespace (words crammed together or an incorrect space before ending
punctuation).

 My conclusion is that blocks straight text (such as paragraphs) cannot be
further marked up with XML without screwing up spacing.

 For example, can anyone get this simple document into HTML without either
removing required spaces or adding inappropriate spaces?

  <?xml version="1.0"?>
  <book>
     <par>
      Is his name really <first>John</first>      <last>Doe</last>?
    </par>
  </book>

 Either you will end up with:
    "Is his name really JohnDoe?"
  which is wrong, or:
    "Is his name really John Doe ?"
  which is also wrong.

 Of course, this is a very simple example. In real-life situations bad
whitespace causes really nasty problems.  Of course, I'm pretty new to XSL
so maybe I just can't read the directions. Here's my XSL example:

 <?xml version="1.0" encoding="utf-8"?>
 <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
  <xsl:output method="html"/>
  <xsl:preserve-space elements="*"/>
    <xsl:template match="/">
      <html><xsl:apply-templates/></html>
    </xsl:template>
 </xsl:transform>

 Does anyone know of a work-around for this common problem?

TIA
Chad Jones


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor