Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Validation XSLT using XSLT 1.0

From: Michael Ludwig <mlu@------------->
To:
Date: 7/3/2008 7:45:00 AM
Ganesh Babu N schrieb:
1. [...] My question is how to get entity name and value in to a test.



<!ENTITY I9780073379470_A_TB004 SYSTEM "9780073379470_A_TB004.tif" NDATA TIFF>



<graphic picfile="I9780073379470_A_TB004"/>

To ensure a value equals another one, maybe you can use the DTD ID and
IDREF feature, and then validate the document against the DTD.

I don't understand why you define an entity the name of which seems to
be identical to its value. What's the point?

2. In the XML file we are using named entities eg:- &nbsp; &acute;
instead of &#123; or &#x123; in XSLT how to find if the XML file
contains entities other than named entities?

Maybe this is an opportunity for the DPH (Desperate Perl Hacker) to come
back on stage: You could search the document using a regular expression
(yes!) and replace all unwanted numerical entities with named entities
of your liking, or - Oxford comma - the official HTML entity catalogue.

Does anyone know of a tool that parses an XML document and outputs it
as ASCII replacing characters with named entities instead of numeric
entites? Named entites you'd probably have to supply yourself?

3. How to find non-ascii characters in the XML file and report an
error using XSLT.

Don't use XSLT for this. Add the following XML declaration to your input
documents:

    <?xml version="1.0" encoding="us-ascii"?>



This will ensure the document won't get parsed unless it is pure ASCII.



4. How to find double enters in the XML file and report an error
using XSLT.

While not tackling the specific problem you're presenting, maybe this
XSL gets you somewhere near your desired result:

<xsl:transform version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:strip-space elements="*"/>
  <xsl:output indent="yes"/>
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
</xsl:transform>

Michael Ludwig


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent