473,587 Members | 2,466 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Enternal entities & namespace

Hi and happy new year to all.

I have a problem with including external entities
with namespace.

I have this master xml wrapper file:

<?xml version="1.0" ?>

<!DOCTYPE log4j:eventSet SYSTEM "log4j.dtd"
[<!ENTITY data SYSTEM "log.xml">]>

<log4j:eventS et version="1.2"
xmlns:log4j="ht tp://jakarta.apache. org/log4j/">
&data;
</log4j:eventSet>

and file "log.xml" looks like this:

<log4j:event logger="cz.web. ContextListener "
timestamp="1136 214913389" level="INFO" thread="Scanner Thread">
<log4j:message> <![CDATA[Destroying context]]></log4j:message>
<log4j:NDC><![CDATA[WebModule]]></log4j:NDC>
</log4j:event>

<log4j:event logger="cz.sap. SapFacade"
timestamp="1136 214913391" level="INFO" thread="Scanner Thread">
<log4j:message> <![CDATA[Cleaning up]]></log4j:message>
<log4j:NDC><![CDATA[WebModule]]></log4j:NDC>
</log4j:event>

When I manualy replace "&data;" with the content of "log.xml"
the validation "xmllint -valid -noout" is OK. But when I try
to include "log.xml" as external entitity, validator reports
error:

log.xml:1: namespace error : Namespace prefix log4j on event is not defined

Also I have tried to remove namespaces from master xml, log.xml
and log4j.dtd and then the validation (with external entity) is OK.

What is the right syntax to namespace defined in master document
will be known during parsing external entity?

Thanks, Netolish
Jan 3 '06 #1
2 1798
* Jiri Netolicky wrote in comp.text.xml:
When I manualy replace "&data;" with the content of "log.xml"
the validation "xmllint -valid -noout" is OK. But when I try
to include "log.xml" as external entitity, validator reports
error:

log.xml:1: namespace error : Namespace prefix log4j on event is not defined
This seems a bug, Namespaces in XML 1.0 does not define well-formedness
for external parsed entities, and a namespace-unaware processor would,
when transforming the document to a standalone one as defined in XML
1.0, generate a namespace-well-formed document, so I don't really see a
reason for generating a namespace error here. I'd file a libxml2 bug.
What is the right syntax to namespace defined in master document
will be known during parsing external entity?


Well, declaring the prefix in the external entity would work and is
certainly a better practise, but I don't think it's clearly required.
--
Björn Höhrmann · mailto:bj****@h oehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Jan 3 '06 #2
RXP [1] is happy with your files as they are -- this looks like a bug
in xmllint.

ht

[1] http://www.ltg.ed.ac.uk/~richard/rxp.html
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Jan 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2051
by: Pieter Claerhout | last post by:
Hi all, what would be the easiest way in Python to decode HTML entities to a unicode string? I would need a function that supports both numerical as well as name based HTML entities. I already did some googling, but I only found a function that decoded numerical ones, and this function didn't support unicode... Cheers,
4
11748
by: Geoff Wilkins | last post by:
I must confess I only come here when I have a problem - so my apologies if this has been raised before: Using my IE v.6 browser, document.write doesn't convert HTML entities (e.g. &apos;, &amp;) to the appropriate character (though NS 6.2 works fine). Obviously I can get round this for particular entities by writing some code to do the...
1
3023
by: AJ Brown | last post by:
I'm loading an XmlDocument object from a string using LoadXml. The string is a well-formed XML fragment (see example) and loads fine, however there are entities (&amp;) within attribute values. The loader parses the incoming entities and converts them to their character references automatically. How would I retain the entity? Example incoming...
2
2794
by: Frantic | last post by:
I'm working on a list of japaneese entities that contain the entity, the unicode hexadecimal code and the xml/sgml entity used for that entity. A unicode document is read into the program, then the program sorts out every doublet and the hexadecimal unicode code is extracted, but I dont know a way to find the xml or sgml-entity equivalent to...
8
19815
by: Steven D'Aprano | last post by:
I have a string containing Latin-1 characters: s = u"© and many more..." I want to convert it to HTML entities: result => "&copy; and many more..." Decimal/hex escapes would be acceptable:
6
10139
by: clintonG | last post by:
Can anybody make sense of this crazy and inconsistent results? // IE7 Feed Reading View disabled displays this raw XML <?xml version="1.0" encoding="utf-8" ?> <!-- AT&T HTML entities & XML <elementsare displayed --> <rss version="2.0"> <channel> <title>AT&T HTML entities & XML <elementsare displayed</title> .... <description>
3
2060
by: bsagert | last post by:
Some web feeds use decimal character entities that seem to confuse Python (or me). For example, the string "doesn't" may be coded as "doesn’t" which should produce a right leaning apostrophe. Python hates decimal entities beyond 128 so it chokes unless you do something like string.encode('utf-8'). Even then, what should have been a...
7
2553
by: tempest | last post by:
Hi all. This is a rather long posting but I have some questions concerning the usage of character entities in XML documents and PCI security compliance. The company I work for is using a third party ecommerce service for hosting its online store. A few months ago this third party commerce site began using PGP file encryption on XML...
22
3907
by: Luna Moon | last post by:
I am reading the book "C++ Annotations", and here is a quote from the book: Namespaces can be defined without a name. Such a namespace is anonymous and it restricts the visibility of the defined entities to the source file in which the anonymous namespace is defined. Entities defined in the anonymous namespace are comparable to C’s static...
0
7920
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5718
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5394
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1189
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.