ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-xml
perl-xml
Re: XPath - save a file
by Romeo Juncu other posts by this author
Jan 25 2001 10:22PM messages near this date
view in the new Beta List Site
Re: XPath - save a file | Re: XPath - save a file
Thanks people!
I'm trying what are you saying but I get namespaces at each element in my
file.
Actually, I want to modify a file.

The input is:
"<sites xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./schemas/Sites.xsd" nomGroupement="ARMONI"> 
 <site maitre="false"> 
  <codeLabo> BELLE</codeLabo>
...
  </codeLabo> 
 </site> 
</sites> 
"

and what $root_node-> toString returns is:
"
<sites xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./schemas/Sites.xsd" nomGroupement="ARMONI"> 
 <site xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./schemas/Sites.xsd" maitre="false"> 
  <codeLabo xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./schemas/Sites.xsd"> BELLE</codeLabo>
...
  </codeLabo> 
 </site> 
</sites> 
"

I really don't want to save this


----- Original Message -----
From: Matt Sergeant <matt@[...].org> 
To: Kip Hampton <khampton@[...].com> 
Cc: Romeo Juncu <rjuncu@[...].com> ; <perl-xml@[...].com>
Sent: Thursday, January 25, 2001 3:02 PM
Subject: Re: XPath - save a file


>  On Thu, 25 Jan 2001, Kip Hampton wrote:
> 
>  >
>  > Hi Romeo,
>  >
>  > > Romeo Juncu wrote:
>  > >
>  > > I just discovered today XML::XPath and I have to make a quick
>  > > decision, but I nned to know....
>  > > XML::XPath is able to save it's content to a xml file???
>  > > I've tried but it didn't work.
>  > >
>  >
>  > try...
>  >
>  > open (XML, ">somefile.xml") || die "File Error: Could not open XML file
>  > for writing. $!";
>  > print XML $root_node->toString;
>  > close XML;
>  >
>  > ...where $root_node is the, er, root node (or top-most element) of the
>  > XPath tree that you've built.
> 
>  <infoset_police>
>  Just to clarify, root node isn't the top-most element, but a virtual node
>  that contains all top-level nodes (which may include comments, processing
>  instructions, and the root element itself).
>  </infoset_police>
> 
>  --
>  <Matt/>
> 
>      /||    ** Director and CTO **
>     //||    **  AxKit.com Ltd   **  ** XML Application Serving **
>    // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
>   // \\| // **     Personal Web Site: http://sergeant.org/     **
>       \\//
>       //\>     //  \>
>  _______________________________________________
>  Perl-XML mailing list
>  Perl-XML@[...].com
>  http://listserv.ActiveState.com/mailman/listinfo/perl-xml

_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
http://listserv.ActiveState.com/mailman/listinfo/perl-xml
Thread:
Romeo Juncu
Kip Hampton
Matt Sergeant
Romeo Juncu
Matt Sergeant

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved