Solved

HElp: Entity --> Linebreak ??

Posted on 2001-07-05
9
573 Views
Last Modified: 2008-02-01
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?
0
Comment
Question by:TMan
  • 4
  • 3
  • 2
9 Comments
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6258849
I'm not sure exactly what you mean....could you please explain a bit more?

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.
0
 

Author Comment

by:TMan
ID: 6258902
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 "&lt;br&gt;" > or ...

it makes &br; -> "<br>"  (<br> appears as text not real linebreak)

I want it to break.
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6258926
Hmm...that's weird....

Could you instead try

<!ENTITY br "&#13">
or
<!ENTITY br "&#10">

Not sure which one is line feed and which one is carriage return...

Max.

0
 

Author Comment

by:TMan
ID: 6259139
no, those both go into oblivion.:)
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 19

Expert Comment

by:DreamMaster
ID: 6259173
Ouch...oblivion huh?

That's not good...

Oh damn...I forgot to make that &#13; and &#10; does that make a difference?

Max.
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6259299
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 &#13; wherever you need the line break?

Max.
0
 
LVL 14

Accepted Solution

by:
avner earned 300 total points
ID: 6259558

TMan,

As Far as I've checked there is no line feed in XML.

And it is very logically , since XML and presentation are two opposite things , and line-feed is core presenetation , there shouldn't be any line-feed in XML.

In xml you can use <BR/> ( if it's XSL>>HTML)
0
 

Author Comment

by:TMan
ID: 6307899
DreamMaster:
I noticed the missing ";" also, but still. &#13; 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" >
0
 
LVL 14

Expert Comment

by:avner
ID: 6308300
That's because your declaration is wrong , you should be using :

<!ELEMENT BR EMPTY>
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Error opening .xml with Excel 2013 4 26
XML file fails to process correctly 3 49
Unattended XML settings 4 100
Removing information on Duplicate XML Nodes 24 71
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now