TMan
asked on
HElp: Entity --> Linebreak ??
I have xml files which are parsed into html with asp&msxml3, texts in XML contain entity &br; where linebreak is wanted.
What kind of line the .dtd must have to make real linebreaks from it. (Is .dtd's rules enough?)
I know this could be done in asp with other processing and even with 'Transform-xsl' but how to do it Easily?
What kind of line the .dtd must have to make real linebreaks from it. (Is .dtd's rules enough?)
I know this could be done in asp with other processing and even with 'Transform-xsl' but how to do it Easily?
ASKER
my .dtd has line
<!ELEMENT TEXT (#PCDATA)>
.xml has lines like:
<TEXT>This is first&br;This is next</TEXT>
.xsl has line:
<p><xsl:value-of select="TEXT"/>
when those are parsed, error about use of unknown entity is displayed.
To pass that error .dtd file has line
<!ENTITY br " " >
which makes &br; -> space.
if i replace previous with anything like
<!ENTITY br "<br>" > or <!ENTITY br "<br>" > or ...
it makes &br; -> "<br>" (<br> appears as text not real linebreak)
I want it to break.
<!ELEMENT TEXT (#PCDATA)>
.xml has lines like:
<TEXT>This is first&br;This is next</TEXT>
.xsl has line:
<p><xsl:value-of select="TEXT"/>
when those are parsed, error about use of unknown entity is displayed.
To pass that error .dtd file has line
<!ENTITY br " " >
which makes &br; -> space.
if i replace previous with anything like
<!ENTITY br "<br>" > or <!ENTITY br "<br>" > or ...
it makes &br; -> "<br>" (<br> appears as text not real linebreak)
I want it to break.
Hmm...that's weird....
Could you instead try
<!ENTITY br "
">
or
<!ENTITY br "
">
Not sure which one is line feed and which one is carriage return...
Max.
Could you instead try
<!ENTITY br "
">
or
<!ENTITY br "
">
Not sure which one is line feed and which one is carriage return...
Max.
ASKER
no, those both go into oblivion.:)
Ouch...oblivion huh?
That's not good...
Oh damn...I forgot to make that and does that make a difference?
Max.
That's not good...
Oh damn...I forgot to make that and does that make a difference?
Max.
It must have something to do with the ; at the end of the entity....
I'm at the point that I think there has to be a predefined entity for a line break....
Maybe all you need to do is put wherever you need the line break?
Max.
I'm at the point that I think there has to be a predefined entity for a line break....
Maybe all you need to do is put wherever you need the line break?
Max.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
DreamMaster:
I noticed the missing ";" also, but still. becomes linebreak in source html, but those, as generally known, are rendered as single space. Must I place the text in <PRE></PRE> to get it right.
avner:
<br/> might be the best choise but, what is wrong:
> my .dtd has line
> <!ELEMENT TEXT (#PCDATA)>
using <BR/> in text like:
<TEXT>This is first<BR/>This is next</TEXT>
Results in Validator error: "Element content is invalid according to the DTD/Schema. Expecting: #PCDATA"
xml-file includes dtd using
<!DOCTYPE MYFILE SYSTEM "myfile.dtd" >
I noticed the missing ";" also, but still. becomes linebreak in source html, but those, as generally known, are rendered as single space. Must I place the text in <PRE></PRE> to get it right.
avner:
<br/> might be the best choise but, what is wrong:
> my .dtd has line
> <!ELEMENT TEXT (#PCDATA)>
using <BR/> in text like:
<TEXT>This is first<BR/>This is next</TEXT>
Results in Validator error: "Element content is invalid according to the DTD/Schema. Expecting: #PCDATA"
xml-file includes dtd using
<!DOCTYPE MYFILE SYSTEM "myfile.dtd" >
That's because your declaration is wrong , you should be using :
<!ELEMENT BR EMPTY>
<!ELEMENT BR EMPTY>
As far as I understand you want to parse the &br; entity into a real Line break...as far as I know that allready does it...
Max.