Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XML
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 10th, 2005, 11:37 AM
Authorized User
 
Join Date: Nov 2004
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
__________________
yengzhai
Reply With Quote
  #2 (permalink)  
Old April 10th, 2005, 12:23 PM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

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)
Reply With Quote
  #3 (permalink)  
Old April 10th, 2005, 12:54 PM
Authorized User
 
Join Date: Nov 2004
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Processing ENTITY and NOTATION lines in xml mrame XSLT 2 August 1st, 2008 01:24 PM
xml validation of entity text in txt files reblev XML 1 May 4th, 2006 09:03 AM
UTF-8 in XML: "Undeclared Entity" errors? richcon XSLT 3 April 30th, 2006 03:19 AM
xml <!ENTITY..... anpham ASP.NET 1.0 and 1.1 Basics 0 June 28th, 2005 09:02 PM
entity references not preserved in XML Output srivalli9 J2EE 0 November 14th, 2003 05:29 PM



All times are GMT -4. The time now is 07:52 PM.


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