Selective validation or "validation from a standpoint"...

Laurent R. Therond

Usenet Archive
Joined
Oct 22, 2004
Messages
1
Reaction score
0
Hi,

I searched for something like this, but could not locate any information. I may have used bad keywords, or it does not make any sense...

Anyhow, there it goes...

Let's say you overlay an XML document with markup of another namespace, how would you tell a validating parser to ignore elements of that other namespace?

Example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> Title </title> </head> <body> <h1> <another-namespace:insert id="0"/> </h1> </body> </html>

Is there any kind of validating parser that could ignore the "another-namespace"-specific markup and simply tell me whether this XHTML document is valid?

Regards,

Laurent
 

Bjoern Hoehrmann

Usenet Archive
Joined
Aug 15, 2000
Messages
719
Reaction score
0
* Laurent R. Therond wrote in comp.text.xml:
Let's say you overlay an XML document with markup of another namespace, how would you tell a validating parser to ignore elements of that other namespace?

With DTDs that is not possible, you need to declare them, etc.
Is there any kind of validating parser that could ignore the "another-namespace"-specific markup and simply tell me whether this XHTML document is valid?

You could use a different schema language or you could strip anything off the document that is not XHTML, a few lines in XSLT.
 

Joris Gillis

Usenet Archive
Joined
Sep 28, 2004
Messages
355
Reaction score
0
Is there any kind of validating parser that could ignore the
You could use a different schema language or you could strip anything off the document that is not XHTML, a few lines in XSLT.

Those few lines could be:

<?xml version="1.0" ?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:eek:utput method="xml" indent="yes"/> <xsl:template match="*"> <xsl:copy><xsl:apply-templates select="@*"/><xsl:apply-templates/></xsl:copy> </xsl:template>

<xsl:template match="@*">
<xsl:attribute name="{local-name}"><xsl:value-of select="."/></xsl:attribute> </xsl:template>

<xsl:template match="*[namespace-uri !='' and namespace-uri != namespace-uri(/*)] "/> <xsl:template match="@*[namespace-uri !='' and namespace-uri != namespace-uri(/*)] "/> </xsl:stylesheet>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,223
Members
248,131
Latest member
Tonypshaw1

Latest Threads

Top