At 12:28 PM 7/24/2000 +0530, Madhu Sudhan B wrote:
>How to skip parsing of a tag in xml.
>In this I want to skip tag <b> </b> i.e not be parsed which is basically a
You got one answer from Jens (re: skipping processing of "undesirable"
elements in an XSLT stylesheet) and another from Fabien (re: embedding
markup in CDATA sections). Both are correct in their own ways.
I'd question, though, the statement that you really want NOT to parse any
given something in your document. As soon as you submit the document to an
XML-aware application, the first thing that the app will do is parse it. As
Fabien says, you can enclose it in a CDATA section and that will prevent it
from being parsed... EVER. This in turn means that (for example) if you
later decide to style all <b> elements in italics, you won't be able to --
because there will effectively be no <b> elements at all, just character
strings containing the <, b, >, and (for the end tag) / characters.
My advice would be simply to relax about the fact that you're stuck with a
display/formatting element. If you've got control of the XML vocabulary
(the DTD, if validating) you might want to replace <b> with <strong>,
<emph>, or something like them -- those are perfectly legitimate "semantic
but not display" properties of text. Otherwise, don't worry about it.
Ignore the <b> using a stylesheet, if you want (as Jens suggests)... but
don't expect to be able to ask a parser to parse only SOME elements, sometime.
John E. Simpson | "I replaced the headlights in my car
http://www.flixml.org | with strobe lights, so it looks like
[log in to unmask] | I'm the only one moving." (Steven Wright)