Hi All,
I have hundreds of small XML files of the form (extrabeous stuff removed):
<?xml version="1.0"?>
<!DOCTYPE page PUBLIC "-//LOCAL//DTD PAGE 0.1//EN" "page.dtd">
<page>
<graphic boardno="entityname1" />
<graphic boardno="entityname2" />
</page>
that I would like to process into this form:
<?xml version="1.0"?>
<!DOCTYPE page [
<!ENTITY entityname1 SYSTEM "entityname1.gif" NDATA gif>
<!ENTITY entityname2 SYSTEM "entityname2.gif" NDATA gif>
<!NOTATION gif SYSTEM "image/gif">
]>
<page>
<graphic boardno="entityname1" />
<graphic boardno="entityname2" />
</page>
That is, I'd like to load each file, find all the boardno attributes,
insert an ENTITY declaration, insert a NOTATION declaration, and write
the result to a file. The XML markup is unchanged, just the internal
DTD is altered. Finding the boardno attributes in a DOM is trivial, but
manipulating the internal DTD subset and getting it to file is eluding me.
Apart from doing the DTD manipulation as a text file, any suggested tool
sets/approaches. Perl, Python, Java, whatever.
Regards,
Chris W 2 1917
I explored the similar issue some time back.
You could look at my findings at, http://gandhimukul.tripod.com/xml/xml.html
Please see, item no, 6.
Regards,
Mukul
On Oct 10, 10:56*am, Chris W <chrisw_j...@yahoo.com.auwrote:
Hi All,
I have hundreds of small XML files of the form (extrabeous stuff removed):
<?xml version="1.0"?>
<!DOCTYPE page PUBLIC "-//LOCAL//DTD PAGE 0.1//EN" "page.dtd">
<page>
* <graphic boardno="entityname1" />
* <graphic boardno="entityname2" />
</page>
that I would like to process into this form:
<?xml version="1.0"?>
<!DOCTYPE page [
* * * * <!ENTITY *entityname1 SYSTEM "entityname1.gif" NDATA gif>
* * * * <!ENTITY *entityname2 SYSTEM "entityname2.gif" NDATA gif>
* * * * <!NOTATION gif SYSTEM "image/gif">
]>
<page>
* <graphic boardno="entityname1" />
* <graphic boardno="entityname2" />
</page>
That is, I'd like to load each file, find all the boardno attributes,
insert an ENTITY declaration, insert a NOTATION declaration, and write
the result to a file. *The XML markup is unchanged, just the internal
DTD is altered. *Finding the boardno attributes in a DOM is trivial, but
manipulating the internal DTD subset and getting it to file is eluding me..
Apart from doing the DTD manipulation as a text file, any suggested tool
sets/approaches. *Perl, Python, Java, whatever.
Regards,
Chris W
Mukul Gandhi wrote:
I explored the similar issue some time back.
You could look at my findings at,
http://gandhimukul.tripod.com/xml/xml.html
Please see, item no, 6.
Regards,
Mukul
Thank you sir. Most helpful.
Chris W This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: les_ander |
last post by:
Hi,
I have many set objects some of which can contain same group of object
while others can be subset of the other. Given a list of sets,
I need to get a list of unique sets such that non of the...
|
by: Chris Dutrow |
last post by:
I searched around on the net for a bit, couldn't find anything though.
I would like to find some code for a function where I input A Range Of
Integers
For example: Function( 1, 100 );
And the...
|
by: Razvan |
last post by:
Hi
What is the difference between an internal and an external entity ?
The first one is defined in the internal subset (not in a separate DTD
file, but in the XML file itself - in...
|
by: Dave |
last post by:
Hello all,
I have a class that contains a large number of discrete pieces of state
information. Any combination of these member variables might be valid for a
given object. Any given member...
|
by: Doug Johnston |
last post by:
Hi,
I am trying to pass the following and it keeps giving the same error...
...
|
by: Dave Boyd |
last post by:
Are there arguments for the built-in commands called via RunCommand
such as acCmdNewObjectReport or do they always require interactive
input? Is the code behind the built-in commands exposed...
|
by: Carlos J. Quintero |
last post by:
Hi,
As you know the current keywords "protected internal" (C#) or "Protected
Friend" (VB.Net) means "Protected Or internal" (C#) or "Protected Or Friend"
(VB.Net), that is, the member is...
|
by: Bill Cohagan |
last post by:
I'm constructing an ASP page that I'd like to test by writing a program that
simulates "many" users hitting the submit button on a form. I assume it's
possible to manually construct an httprequest...
|
by: Blaine Manyluk |
last post by:
I have a very unusual request.
I need to be able to generate reports and save them as TIF
files, with full programmatic control. The application will
provide the filenames. Each page of the...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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...
|
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,...
| |