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

Home Posts Topics Members FAQ

Confusing message when using XML::Writer module in Perl

I'm getting the following message when I run my Perl script that uses
the XML::Writer module:

"Processing instruction target begins with 'xml' at
.../makeconf/LW/LWTest.pm line 75"

The pi() statement is almost identical to the example for the module
at cpan.org. In fact, I tried replacing my use with the example and
got the same result. Can anyone tell me why I'm getting this warning,
even though I'm getting the correct output?

Here is the code snippet where I'm using XML::Writer:

###BEGIN SNIP
my $output = new IO::File(">$out _file_path");
my $writer = new XML::Writer( OUTPUT => $output, DATA_MODE => 1,
DATA_INDENT => 4 );

$writer->xmlDecl( 'ISO-8859-1', 'yes' );
$writer->pi('xml-stylesheet', 'type="text/xsl" href="LW_Test.x sl"');
#line 75
$writer->startTag( 'testcase' );
$writer->dataElement( "name", $test_case_name );
$writer->dataElement( "timestamp" , $test_case_time stamp);
$writer->dataElement( "overview", $test_case_over view);

foreach(@condit ions) {
my $cond_id = LW::TestConditi on->getConditionID ($_);
my $cond_comp = LW::TestConditi on->getConditionCo mp($_);
my $cond_pass_fail = LW::TestConditi on->getConditionPa ssFail($_);
my $cond_pass_desc = LW::TestConditi on->getConditionDe sc($_);
my $cond_err_msg = LW::TestConditi on->getConditionEr rMsg($_);

$writer->startTag( 'condition', 'id' => $cond_id,
'completed' => $cond_comp,
'pass_fail' => $cond_pass_fail );

$writer->dataElement( "descriptio n", $cond_pass_desc );
$writer->dataElement( "err_msg", $cond_err_msg);
$writer->endTag( 'condition' );
}

$writer->endTag( 'testcase' );
###END SNIP

The output file looks like this (which is what I wanted):

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes "?>
<?xml-stylesheet href="style.css " type="text/css"?>

<testcase>
<name>my test case</name>
<timestamp>Tu e Sep 30 11:19:55 2003</timestamp>
<overview>tex t containing many wise and wonderful
things</overview>
<condition id="1" completed="yes" pass_fail="pass ">
<description>th is is the description for condition
1</description>
<err_msg>none </err_msg>
</condition>
<condition id="2" completed="no" pass_fail="fail ">
<description>th is is the description for condition
2</description>
<err_msg>condit ion 1 failed</err_msg>
</condition>
<condition id="3" completed="yes" pass_fail="pass ">
<description>th is is the description for condition
3</description>
<err_msg>none </err_msg>
</condition>
<condition id="4" completed="yes" pass_fail="fail ">
<description>th is is the description for condition
4</description>
<err_msg>file s not the same</err_msg>
</condition>
</testcase>
Jul 20 '05 #1
2 2297
da******@pacbel l.net (David McBride) writes:
The pi() statement is almost identical to the example for the module
at cpan.org. In fact, I tried replacing my use with the example and
got the same result. Can anyone tell me why I'm getting this warning,
even though I'm getting the correct output?


Because the XML-Writer module is getting a little old, and I haven't
been maintaining it actively. This recommendation

http://www.w3.org/TR/xml-stylesheet/

did not exist (or at least, wasn't a REC) when I wrote the module, and
the XML spec reserves PI's starting with "xml". I seem to remember
that there was a way to disable this kind of strict checking, but I
haven't look at the code for a few years.
All the best,
David
Jul 20 '05 #2
David Megginson <no****@attglob al.net> wrote in message news:<87******* *****@megginson .com>...
da******@pacbel l.net (David McBride) writes:
The pi() statement is almost identical to the example for the module
at cpan.org. In fact, I tried replacing my use with the example and
got the same result. Can anyone tell me why I'm getting this warning,
even though I'm getting the correct output?
Because the XML-Writer module is getting a little old, and I haven't
been maintaining it actively. This recommendation

http://www.w3.org/TR/xml-stylesheet/

did not exist (or at least, wasn't a REC) when I wrote the module, and
the XML spec reserves PI's starting with "xml". I seem to remember
that there was a way to disable this kind of strict checking, but I
haven't look at the code for a few years.
All the best,
David

David,

Thanks for responding.

According to the documentation, strict checking can be turned off by
using "UNSAFE" as follows:

my $writer = new XML::Writer( OUTPUT => $output, DATA_MODE => 1,
DATA_INDENT => 4, UNSAFE => 1);

I didn't quite understand your statement, though:
... This recommendation

http://www.w3.org/TR/xml-stylesheet/

did not exist (or at least, wasn't a REC) when I wrote the module, and
the XML spec reserves PI's starting with "xml".


This seems odd to me because one of the examples in the documentation
for XML::Writer at cpan.org actually uses xml-stylesheet to
demonstrate the use of pi(). Maybe I'm just naive, but it seems like
this example would not have been used if xml-stylesheet was
incompatible with XML::Writer->pi();

One final thought: assuming that the module is a little out of date,
have you given any thought to another revision? It's such a useful
tool, I think that it would be a great service to keep it up to date.

Thanks again for your response.

v/r

David McBride
Jul 20 '05 #3

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

Similar topics

7
1609
by: Marco Meoni | last post by:
Have you ever write an XML Writer in wxPython? A Writer that from a GUI can compose XML Files. Thanks. Marco.
6
10554
by: atinti | last post by:
I'm tyring to write something that will send a simple email using Perl so far this is what I have #!/usr/bin/perl -w use strict; my $executable = "saplotus.exe'; my $server = 'test@domain'; my $from = 'aetinti@gmail.com';
8
5382
crazy4perl
by: crazy4perl | last post by:
hi all !!! i m new to perl. can anyone here please tell me how to communicate with websites using perl. do we need to use CGI for that or simply by using perl... simply i just wnt to fill some field on the web page using perl.. thanks in advance...:-)
3
6829
by: hakiran | last post by:
Hello all, I have been using Perl DBI the last 6months or so. I use it extensively with MySQL. But recently i tried to access Oracle DB with it and was having trouble. Any help would be appreciated. Here is the code and the error i get. I know the table/view do exist. Thanks all Kiran ----------
4
19688
by: jram01 | last post by:
Hi Folks, I am facing problem to to execute .sql command in sql prompt using perl script. I am able to connect sql promt using " my $odbcinput = "odbcinput.txt"; my $odbcoutput = "odbcoutput.txt"; open (ODBCSQLFH, ">$odbcinput") || die "Unable to create input file ($odbcinput) for odbcsql\n";
1
1516
by: nehaz | last post by:
can anyone tell me how can i configure a device from HTTP page using perl ? I am using following cmd to enter the http page use HTTP::Request; $req = HTTP::Request->new($httpRequestMethod => "http://192.168.1.1/"); sleep 10; $req->authorization_basic("admin","password"); sleep 10; How can i change values on that page ? will print statement work or is there any other way to do that ?
2
1872
by: nb999 | last post by:
Hello Friends, I was trying to simulate a vending machine using perl just as a fun project. Heres the code I wrote: #!/usr/bin/perl $wt = $ARGV;
3
2755
by: poolboi | last post by:
hi guys, i dunno if this post should be in Perl or MySQL but i'm using Perl DBI to do manupilations now in MySQL i've got problem trying to input 2 arrays of data into 2 fields at the same time say for example now i got
0
1549
by: koti688 | last post by:
Hi Mates, Can u Please tell me how to connect to Berkely Db using Perl . I have two files , i need to access these file using perl. These files with .db extension contains Keys and its Signatures. I need to List out the keys and vaules and signatures respectively.I Have installed Berkely-DB(0.22), BerkelyDB-Lite,DB_File(1.816) using PPM also. Please tell me if u know any thing , about connecting to berkely Db using perl even. ...
0
9566
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
9388
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9333
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6800
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
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
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
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.