p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   XML (http://p2p.wrox.com/forumdisplay.php?f=91)
-   -   xml parameter entity (http://p2p.wrox.com/showthread.php?t=27936)

yengzhai April 10th, 2005 11:37 AM

xml parameter entity
 
I am new to xml.

In my DTD section, I have this:

Code:

<!ENTITY % entity "Wrox Entity">
In the body section:
Code:

<book>
<title>XML</title>
<author>abc</author>
<publisher>%entity;</publisher>
</book>

Output in IE6:

Code:

<title>XML</title>
<author>abc</author>
<publisher>%entity;</publisher>
</book>

The output is incorrect where I expect:

Code:

<publisher>Wrox Entity</publisher>
What went wrong to my xml coding?

yengzhai

joefawcett April 10th, 2005 12:23 PM

Your entity declaration should look like:
Code:

<!ENTITY myEntity "Wrox Entity">
To use it you need am ampersand (&) before and a semi-colon (;) after:
Code:

<publisher>&myEntity;</publisher>
The % sign in entities is for those that are used only within the DTD itself.

--

Joe (Microsoft MVP - XML)

yengzhai April 10th, 2005 12:54 PM

I've got it, thanks!

This time I try to create .dtd (my_external.dtd) file in Window XP. But the problem is the file can't be recognized by the OS. Visual Studio.NET seems like does not have this function (to create dtd file). What should I do?

yengzhai


All times are GMT -4. The time now is 11:42 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.