473,795 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

NITF: cant load objDOM because of HTML-entities

Hi,

I am receiving news from a press-agency in NITF-XML.
Then I want to import them into my CMS using XML&SOAP.
The import-tool runs fine if I have got an xml-document with real
German special characters, not HTML entities.

Unfortunately I receive the news with entities and get this error
(translate from German):
Parse Error in input XML file: Reference to a not definded entity
'auml'.

my code:
Set objDom = CreateObject("M SXML2.DOMDocume nt.3.0")
objDom.setPrope rty "SelectionLangu age", "XPath"
objDom.async = False objDom.setPrope rty "SelectionNames paces",
"xmlns:tcmapi=' http://www.tridion.com/ContentManager/5.0/TCMAPI'"
objDom.Load (strFilePath & strXmlFileName)
If Not objDom.parseErr or.reason = "" Then
WriteToLog "Parse Error in input XML file: " &
objDom.parseErr or.reason
End If

thanks for your help!
Ragnar
Jul 20 '05 #1
10 3557


Ragnar Heil wrote:

I am receiving news from a press-agency in NITF-XML.
Then I want to import them into my CMS using XML&SOAP.
The import-tool runs fine if I have got an xml-document with real
German special characters, not HTML entities.

Unfortunately I receive the news with entities and get this error
(translate from German):
Parse Error in input XML file: Reference to a not definded entity
'auml'.

my code:
Set objDom = CreateObject("M SXML2.DOMDocume nt.3.0")
objDom.setPrope rty "SelectionLangu age", "XPath"
objDom.async = False objDom.setPrope rty "SelectionNames paces",
"xmlns:tcmapi=' http://www.tridion.com/ContentManager/5.0/TCMAPI'"
objDom.Load (strFilePath & strXmlFileName)
If Not objDom.parseErr or.reason = "" Then
WriteToLog "Parse Error in input XML file: " &
objDom.parseErr or.reason
End If


Well if an XML document uses entity references those entities need to be
defined thus if @auml; is used there needs to be an entity declaration
in the document type definition that declares the entity, otherwise the
XML is not well-formed.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2
Martin Honnen <ma*******@yaho o.de> wrote in news:419ce15d$0 $28979$9b4e6d93
@newsread4.arco r-online.net:
Well if an XML document uses entity references those entities need to be
defined thus if @auml; is used there needs to be an entity declaration
in the document type definition that declares the entity, otherwise the
XML is not well-formed.


Hi Martin,

now I have seen that this thread talks about a similar issue
Subject: XML: "undefined entity"
news:cn******** **@netlx020.civ .utwente.nl

yes, you are right, entity references have to be defined in the DTD like
<!ENTITY % HTMLlat1 PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">

I am really wondering why the NITF-files have no reference to a DTD.
I could modify the NITF.dtd on our server but not the incoming files.
Would you do it? take the incoming files and add a DTD-reference to them?
Then I also can do another way of hacking and replace all entities with the
real special characters (Umlaute).

Jul 20 '05 #3
Ragnar Heil wrote:
I am receiving news from a press-agency in NITF-XML.
Then I want to import them into my CMS using XML&SOAP.
The import-tool runs fine if I have got an xml-document with real
German special characters, not HTML entities.

Unfortunately I receive the news with entities


Tell the press agency to send XML:
a) use characters directly with the appropriat encoding, or
b) use numerical references (e.g. &#xfc; for german u umlaut).
and to add a document type declaration.

If you have a contract with them to get NITF-XML, they have to fulfill
their part (send NITF-XML and not some code that looks like XML).
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #4


Ragnar Heil wrote:

I am really wondering why the NITF-files have no reference to a DTD.
I could modify the NITF.dtd on our server but not the incoming files.
Would you do it? take the incoming files and add a DTD-reference to them?


If someone tells you that he is going to provide XML and it is not XML
then you should probably insist that XML is being sent and not something
that fullfills some rules of XML but not others. Otherwise you are
forced to fix their not well-formed markup and as you can't use existing
XML parsers to that you are left with some text processing.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #5
Johannes Koch <ko**@w3develop ment.de> wrote in news:305s27F2tc lrsU1@uni-
berlin.de:
If you have a contract with them to get NITF-XML, they have to fulfill
their part (send NITF-XML and not some code that looks like XML).


HI Johannes and Martin,

now I talked to a technical person from the press agency.
They are aware that their NITF-xml-documents are not valid and wellformed
:-(

Now I am thinking of ways how to load the news-file into my objDOM without
getting an error message from the parser which checks the validation
Ragnar
Jul 20 '05 #6
Ragnar Heil wrote:
now I talked to a technical person from the press agency.
They are aware that their NITF-xml-documents are not valid and wellformed
:-(


And they don't want to change it?
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #7
Johannes Koch <ko**@w3develop ment.de> wrote in
news:30******** *****@uni-berlin.de:
And they don't want to change it?


well, I am going to mention this to DPA ;-)

Are you aware of any tools which convert files with entities to files with
Umlaute?
Ragnar

Jul 20 '05 #8
Ragnar Heil wrote:
well, I am going to mention this to DPA ;-)
Good luck :-)
Are you aware of any tools which convert files with entities to files with
Umlaute?


Maybe, recode can do this.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #9
On 18 Nov 2004 09:09:44 -0800, r@gnar.de (Ragnar Heil) wrote:
I am receiving news from a press-agency in NITF-XML.


Most (some ? / many ? / nearly all ?) NITF / NewsML / RSS feeds become
invalid whenever they encounters an accented character. You have no
practical hope of fixing this, because the organisations are beyond
your control and you really just have to deal with the garbage they're
sending you. Raise the issue with them, complain as loudly as you
can, but don't expect them to fix it.

I use some very ugly pre-processor code before the parser. If the
first parse attempt fails for this reason, I re-try with a version
that has had a reference to an appropriate local DTD added to it.

--
Smert' spamionam
Jul 20 '05 #10

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

Similar topics

1
3138
by: d.morel | last post by:
Hello all..this is driving me crazy... I cant run applets in IE6.0 using the embedded Oracle 10g server. here are my peticulars... - Windows XP no service packs (offline machine) - jre 1.4.2_03 as my xp java runtime.. I matched it to the Oracle10g version (if that even matters...) - Java plug-in installed... I have tried using
3
3217
by: Nina | last post by:
Hello, I have been given the project to convert NITF files to HTML. We already convert RSS-RDF files to HTML on a linux system and it was quite easy using the tutorial at webreference http://www.webreference.com/perl/tutorial/8/ It worked out something like this perl -MCPAN -e "install XML::Parser" perl -MCPAN -e "install XML::RSS
2
3176
by: kmunderwood | last post by:
I am having trouble changing the font size when extracting xml into an html web page. I think it can be done so many ways, that my searches bring up examples that I am not familiar with. I am a newbie at xml and xsl This is my xml("index.xml")page(I can not change this, it comes to me this way. <?xml version="1.0" encoding="iso-8859-1" ?>
1
3017
by: sean | last post by:
var strPath = "c:\myXml.xml"; var objDom = new ActiveXObject("Msxml2.DOMDocument"); alert('step 1'); objDom.load(strPath); alert('step 2'); ................ AFTER step 1 I'm getting an errorrrrrrrrrrrr. Im just going crazy. Error: Access denied!
1
3256
by: bayouprophet | last post by:
Cant get menu script to to put linked page in the same frame. I am new to Java and I am wondering what am I doing wrong? below are my java applet file, frame.html file, and my text file and one of my link file that should load next to the menu on the same page. And Thank You in advance. Here is my menu applet: <html>
4
2666
by: Jake Lewis | last post by:
I have an HTML page that loads fine including the .js file <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <script language="JavaScript" type="text/JavaScript" src="ve3d.js" ></script> </head>
1
940
by: Mike | last post by:
'Declare array to load file Dim mstrCarinfo(9, 3) As String 'Declare streamreader Private datvehiclelookup As StreamReader Private Sub Loadarray() ' Load Array Dim intCol As Integer Dim intRow As Integer
2
2411
by: ElizaInternet | last post by:
I need convert NITF Xmls for insert into BD SQL. I try convert to file text and then insert into BD I used the Syndication:NITF of perl for this convertion. Any have information about this??, I can´t convert all tags and export to file text. Somebody knows another form to do it??? thanks for help
1
1459
by: kandarp | last post by:
Hi I want to convert csv file into NITF Format using asp.net 2005. if you have any idea or code for it than help me. its very import for me. Thanks Kandarp Joshi
11
11684
by: globalrev | last post by:
http://www.pygame.org/docs/ref/mixer.html import pygame #pygame.mixer.init(frequency=22050, size=-16, channels=2, buffer=3072) //it complained abiout words= so i guess its only the nbrs should be there// pygame.mixer.init(22050, -16, 2, 3072) pygame.mixer.music.load("example1.mp3")
0
9672
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10438
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9042
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6780
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
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
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.