Re: Question on XML::XPath class

Adam Pfeiffer <[email protected]> Fri, 13 Oct 2017 14:46:27 -0600
Newsgroups gmane.comp.lang.perl.xml
Message-ID <CAGOKLU-DG1dWjHMfqQFiyZktzyBg+JAt31PHS=XSpZNqUEvdNg@mail.gmail.com>
--===============0314162057==
Content-Type: multipart/alternative; boundary="001a114760823c7af8055b73c039"

--001a114760823c7af8055b73c039
Content-Type: text/plain; charset="UTF-8"

I tried your suggestion like this:
<code>
#!/usr/bin/perl
use XML::XPath;
my $xp = XML::XPath->new(xml => '<root />');
$xp->createNode('/root/extension-tunnel[name="0/1"]/qos-ratio/ip-high-qos');
</code>

The code hung at the call to createNode.  I believe trying to create a full
XML structure using an XPath isn't the correct approach after my testing.
I will approach the solution differently.

Thanks

On Thu, Oct 12, 2017 at 8:06 PM, Liam R. E. Quin <[email protected]> wrote:

> On Thu, 2017-10-12 at 14:11 -0600, Adam Pfeiffer wrote:
> > Hi,
> >
> > I am using the Perl XML::XPath module and have encountered something
> > which
> > might be a bug.  I am starting with an empty object by calling this:
>
> I'm not sure that's a supported use case. Try
>     my $xp = XML::XPath->new( xml => "<root />" );
> and see if that helps?
>
> Liam
>
> --
> Liam Quin, W3C, http://www.w3.org/People/Quin/
> Staff contact for Verifiable Claims WG, SVG WG, XQuery WG
>
> Web slave for http://www.fromoldbooks.org/
>

--001a114760823c7af8055b73c039
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I tried your suggestion like this:<div>&lt;code&gt;</div><=
div><div>#!/usr/bin/perl</div><div>use XML::XPath;</div><div>my $xp =3D XML=
::XPath-&gt;new(xml =3D&gt; &#39;&lt;root /&gt;&#39;);</div><div>$xp-&gt;cr=
eateNode(&#39;/root/extension-tunnel[name=3D&quot;0/1&quot;]/qos-ratio/ip-h=
igh-qos&#39;);</div></div><div>&lt;/code&gt;</div><div><br></div><div>The c=
ode hung at the call to createNode.=C2=A0 I believe trying to create a full=
 XML structure using an XPath isn&#39;t the correct approach after my testi=
ng.=C2=A0 I will approach the solution differently.</div><div><br></div><di=
v>Thanks</div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quot=
e">On Thu, Oct 12, 2017 at 8:06 PM, Liam R. E. Quin <span dir=3D"ltr">&lt;<=
a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a>&gt;</span> =
wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bord=
er-left:1px #ccc solid;padding-left:1ex"><span class=3D"">On Thu, 2017-10-1=
2 at 14:11 -0600, Adam Pfeiffer wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I am using the Perl XML::XPath module and have encountered something<b=
r>
&gt; which<br>
&gt; might be a bug.=C2=A0=C2=A0I am starting with an empty object by calli=
ng this:<br>
<br>
</span>I&#39;m not sure that&#39;s a supported use case. Try<br>
=C2=A0 =C2=A0 my $xp =3D XML::XPath-&gt;new( xml =3D&gt; &quot;&lt;root /&g=
t;&quot; );<br>
and see if that helps?<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
Liam<br>
<br>
--<br>
Liam Quin, W3C, <a href=3D"http://www.w3.org/People/Quin/" rel=3D"noreferre=
r" target=3D"_blank">http://www.w3.org/People/Quin/</a><br>
Staff contact for Verifiable Claims WG, SVG WG, XQuery WG<br>
<br>
Web slave for <a href=3D"http://www.fromoldbooks.org/" rel=3D"noreferrer" t=
arget=3D"_blank">http://www.fromoldbooks.org/</a><br>
</font></span></blockquote></div><br></div>

--001a114760823c7af8055b73c039--

--===============0314162057==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

--===============0314162057==--