xsltproc and Entities

B

Brett

I am producing some formatted text using xslt, and therefore have a
lot of carriage returns. Instead of placing a:
<text>
</text>
everywhere I decided to form an entity like so:
<!DOCTYPE stylesheet [
<!ENTITY cr "<xsl:text>
</xsl:text>">
]>

and then place a &cr; everywhere I want a carriage return. It works
fine in xmlspy, but when using xsltproc, I get namespace errors,
specifically:
"warning: Namespace prefix xsl is not defined"
and
"compilation error: file foo.xslt line 1 element text
Namespaces prefix used for multiple namespaces"

Any idea on what I am doing wrong?
 
A

Alain Ketterlin

I am producing some formatted text using xslt, and therefore have a
lot of carriage returns. Instead of placing a:
<text>
</text>
everywhere I decided to form an entity like so:
<!DOCTYPE stylesheet [
<!ENTITY cr "<xsl:text>
</xsl:text>">
]>

and then place a &cr; everywhere I want a carriage return. It works
fine in xmlspy, but when using xsltproc, I get namespace errors,
specifically:
"warning: Namespace prefix xsl is not defined"

Which is probably true at the time the parser reads the internal
subset... DTDs are definitely problematic with namespaces.

By the way, why not use
to denote carriage return?

-- Alain.
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top