Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 10th, 2005, 11:37 AM
Authorized User
 
Join Date: Nov 2004
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
 
Old April 10th, 2005, 12:23 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
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)
 
Old April 10th, 2005, 12:54 PM
Authorized User
 
Join Date: Nov 2004
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





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





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