You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(5) |
Jun
(1) |
Jul
(2) |
Aug
(13) |
Sep
(1) |
Oct
(6) |
Nov
(4) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
(8) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
(2) |
Sep
(1) |
Oct
(2) |
Nov
|
Dec
|
2005 |
Jan
(2) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(3) |
Oct
|
Nov
(9) |
Dec
(4) |
2006 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(6) |
Nov
(4) |
Dec
(9) |
2007 |
Jan
(3) |
Feb
(8) |
Mar
(7) |
Apr
(13) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(26) |
Dec
|
2011 |
Jan
(11) |
Feb
(1) |
Mar
(2) |
Apr
(10) |
May
|
Jun
(3) |
Jul
(1) |
Aug
|
Sep
(2) |
Oct
(4) |
Nov
|
Dec
|
2012 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(3) |
2013 |
Jan
(6) |
Feb
(1) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Daniel V. <vei...@re...> - 2004-02-09 10:56:14
|
On Sun, Feb 08, 2004 at 06:15:23PM -0500, Mikhail S Grushinskiy wrote: > Fix has been committed to xmlstarlet CVS. So was that a pure xmlstarlet bug or a libxml2 bug ? I'm a bit confused about the current status :-) Daniel -- Daniel Veillard | Red Hat Network https://rhn.redhat.com/ vei...@re... | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ |
From: Mikhail S G. <mgr...@co...> - 2004-02-08 23:15:26
|
Fix has been committed to xmlstarlet CVS. ----- Original Message ----- From: "Mikhail S Grushinskiy" <mgr...@co...> To: "Elliotte Harold" <el...@me...>; <xm...@gn...> Cc: <xml...@li...> Sent: Sunday, February 08, 2004 5:07 PM Subject: Re: [xml] Possible bug in canonicalization > Elliotte, > > It seems this bug was introduced in xmlstarlet. > > mikhail@greybox /cygdrive/c/msys/1.0/home/mikhail/XMLSTARLET/libxml2-2.6.5 > $ echo "<xml/>" | xml c14n --with-comments - > <xml></xml> > [new line here] > mikhail@greybox /cygdrive/c/msys/1.0/home/mikhail/XMLSTARLET/libxml2-2.6.5 > $ echo "<xml/>" | ./testC14N.exe --with-comments - > <xml></xml> > mikhail@greybox /cygdrive/c/msys/1.0/home/mikhail/XMLSTARLET/libxml2-2.6.5 > > > I will fix it in CVS and I will let you know. > > --MG > > ----- Original Message ----- > From: "Elliotte Harold" <el...@me...> > To: <xm...@gn...> > Cc: <xml...@li...> > Sent: Sunday, February 08, 2004 3:51 PM > Subject: [xml] Possible bug in canonicalization > > > > I've encountered a likely bug in libxml's canonicalization. I am using > > libxml 2.6.5, the latest released version. I probably don't have the > > latest release of libxslt, though. This is on Red Hat Linux 8. I am not > > certain of this bug only because I am only accessing canonicalization > > through xmlstarlet, rather than through my own code. It is possible the > > problem is in xmlstarlet's interface to libxml2. However, the nature of > > the bug does mean that if it's in the libxml code it should be easy to > > spot. Ditto if it's in xmlstarlet. > > > > In brief, the canonicalization is placing a line feed at the end of the > > canonicalized document, at least when there are no comments or PIs in > > the epilog (I haven't tested what happens when there are such nodes in > > the epilog). According to the canonical XML spec, section 4.3, this is > > wrong: > > > > The C14N-20000119 > > <http://www.w3.org/TR/2001/REC-xml-c14n-20010315#C14N-20000119> > > Canonical XML draft placed a #xA after each PI outside of the document > > element as well as a #xA after the end tag of the document element. The > > method in this specification performs the same function except for > > omitting the final #xA after the last PI (or comment or end tag of the > > document element). This technique ensures that PI (and comment) children > > of the root are separated from markup by a line feed even if root node > > or the document element are omitted from the output node-set. > > > > -- > > Elliotte Rusty Harold > > > > > > > > _______________________________________________ > > xml mailing list, project page http://xmlsoft.org/ > > xm...@gn... > > http://mail.gnome.org/mailman/listinfo/xml > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.577 / Virus Database: 366 - Release Date: 2/3/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.577 / Virus Database: 366 - Release Date: 2/3/2004 |
From: Mikhail S G. <mgr...@co...> - 2004-02-08 22:09:30
|
Elliotte, It seems this bug was introduced in xmlstarlet. mikhail@greybox /cygdrive/c/msys/1.0/home/mikhail/XMLSTARLET/libxml2-2.6.5 $ echo "<xml/>" | xml c14n --with-comments - <xml></xml> [new line here] mikhail@greybox /cygdrive/c/msys/1.0/home/mikhail/XMLSTARLET/libxml2-2.6.5 $ echo "<xml/>" | ./testC14N.exe --with-comments - <xml></xml> mikhail@greybox /cygdrive/c/msys/1.0/home/mikhail/XMLSTARLET/libxml2-2.6.5 I will fix it in CVS and I will let you know. --MG ----- Original Message ----- From: "Elliotte Harold" <el...@me...> To: <xm...@gn...> Cc: <xml...@li...> Sent: Sunday, February 08, 2004 3:51 PM Subject: [xml] Possible bug in canonicalization > I've encountered a likely bug in libxml's canonicalization. I am using > libxml 2.6.5, the latest released version. I probably don't have the > latest release of libxslt, though. This is on Red Hat Linux 8. I am not > certain of this bug only because I am only accessing canonicalization > through xmlstarlet, rather than through my own code. It is possible the > problem is in xmlstarlet's interface to libxml2. However, the nature of > the bug does mean that if it's in the libxml code it should be easy to > spot. Ditto if it's in xmlstarlet. > > In brief, the canonicalization is placing a line feed at the end of the > canonicalized document, at least when there are no comments or PIs in > the epilog (I haven't tested what happens when there are such nodes in > the epilog). According to the canonical XML spec, section 4.3, this is > wrong: > > The C14N-20000119 > <http://www.w3.org/TR/2001/REC-xml-c14n-20010315#C14N-20000119> > Canonical XML draft placed a #xA after each PI outside of the document > element as well as a #xA after the end tag of the document element. The > method in this specification performs the same function except for > omitting the final #xA after the last PI (or comment or end tag of the > document element). This technique ensures that PI (and comment) children > of the root are separated from markup by a line feed even if root node > or the document element are omitted from the output node-set. > > -- > Elliotte Rusty Harold > > > > _______________________________________________ > xml mailing list, project page http://xmlsoft.org/ > xm...@gn... > http://mail.gnome.org/mailman/listinfo/xml --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.577 / Virus Database: 366 - Release Date: 2/3/2004 |
From: Elliotte H. <el...@me...> - 2004-02-08 20:51:38
|
I've encountered a likely bug in libxml's canonicalization. I am using libxml 2.6.5, the latest released version. I probably don't have the latest release of libxslt, though. This is on Red Hat Linux 8. I am not certain of this bug only because I am only accessing canonicalization through xmlstarlet, rather than through my own code. It is possible the problem is in xmlstarlet's interface to libxml2. However, the nature of the bug does mean that if it's in the libxml code it should be easy to spot. Ditto if it's in xmlstarlet. In brief, the canonicalization is placing a line feed at the end of the canonicalized document, at least when there are no comments or PIs in the epilog (I haven't tested what happens when there are such nodes in the epilog). According to the canonical XML spec, section 4.3, this is wrong: The C14N-20000119 <http://www.w3.org/TR/2001/REC-xml-c14n-20010315#C14N-20000119> Canonical XML draft placed a #xA after each PI outside of the document element as well as a #xA after the end tag of the document element. The method in this specification performs the same function except for omitting the final #xA after the last PI (or comment or end tag of the document element). This technique ensures that PI (and comment) children of the root are separated from markup by a line feed even if root node or the document element are omitted from the output node-set. -- Elliotte Rusty Harold |
From: Mikhail S G. <mgr...@co...> - 2004-02-06 02:15:50
|
XMLStarlet Command Line XML Toolkit 0.8.1 released XMLStarlet Command Line XML Toolkit http://xmlstar.sourceforge.net/ XMLStarlet is a set of command line utilities (tools) to transform, query, validate, and edit XML documents and files using simple set of shell commands in similar way it is done for plain text files using UNIX grep, sed, awk, diff, patch, join, etc commands. This set of command line utilities can be used by those who deal with many XML documents on UNIX shell command prompt as well as for automated XML processing with shell scripts. The toolkit's feature set includes options to: Check or validate XML files (simple well-formedness check, DTD, XSD, RelaxNG) Calculate values of XPath expressions on XML files (such as running sums, etc) Search XML files for matches to given XPath expressions Apply XSLT stylesheets to XML documents (including EXSLT support, and passing parameters to stylesheets) Query XML documents (ex. query for value of some elements of attributes, sorting, etc) Modify or edit XML documents (ex. delete some elements) Format or "beautify" XML documents (as changing indentation, etc) Fetch XML documents using http:// or ftp:// URLs Browse tree structure of XML documents (in similar way to 'ls' command for directories) Include one XML document into another using XInclude XML c14n canonicalization Escape/unescape special XML characters in input text Display directories in XML format Convert XML into PYX format (based on ESIS - ISO 8879) and vice versa XMLStarlet command line utility is written in C and uses libxml2 and libxslt from http://xmlsoft.org/. Implementation of extensive choice of options for XMLStarlet utility was only possible because of rich feature set of libxml2 and libxslt (many thanks to the developers of those libraries for great work). XMLStarlet is linked statically to both libxml2 and libxslt, so generally all you need to process XML documents is one executable file. To run XmlStarlet utility you can simple type 'xml' on command line and see list of options available. XMLStarlet is open source freeware under MIT license which allows free use and distribution for both commercial and non-commercial projects. New binaries for Linux/Windows/Solaris have been released. (i586 rpm are for Mandrake-9.2 and i386 are for RedHat 7.3) We welcome any user's feedback on this project which would greatly help us to improve its quality. Comments, suggestions, feature requests, bug reports can be done via SourceForge project web site (see XMLStarlet Sourceforge forums at http://sourceforge.net/forum/?group_id=66612, or XMLStarlet mailing list at http://lists.sourceforge.net/lists/listinfo/xmlstar-devel) ------------------------------------------------ Changes since 0.7.0 1. Recompiled against recent libxml2-2.6.5 and libxslt-1.1.2 libraries 2. New binaries for Windows/Linux/Solaris 3. Additional examples and tests 4. Fixed DTD validation bugs 5. Updated documentation 6. New man page --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.577 / Virus Database: 366 - Release Date: 2/3/2004 |
From: Mikhail G. <mgr...@co...> - 2003-12-17 05:42:09
|
Thanks for the patch! I will try to apply it (at least some parts) before next version comes out. ----- Original Message ----- From: "Olivier Courtin" <oli...@pn...> To: <xml...@li...> Sent: Sunday, December 14, 2003 2:10 PM Subject: [Xmlstar-devel] Compilation Warning > Hi, > > As i wanted to play with xmlstarlet, i get several compilation warning. > (gcc 3.2.3, linux 2.4.19, libxml 2.6.2, xmlstarlet CVS or 0.7.0) > > So i send you a patch with following changelog : > ( notice that i'm not at all a c expert, so... ) > > 1) Remove Warning with -Wall -pedantic compilation : > > - usage string chunk -> 509 char min on ISO C90 > > > 2) Remove Warning with -Wall -ansi -pedantic compilation : > > - add ansi flag, and remove -g -> configure.in > - snprintf convert as sprintf -> ANSI compliant > - strdup implementation -> ANSI compliant > - stat macro modification (xml_ls.c) -> POSIX compliant > - lstat convert as stat -> ansi compliant > > > 3) Remove LibXml API Warning : > - SAX handler modification (xml_pyx.c) -> API libxml 2.6.2 > - docbook support removed -> deprecated since libxml 2.6.0 API > > > 4) User Friendly : > - configure.in modification -> check libxml2 version >= 2.6.2 > > > 5) Tidy : > - remove unused fonction and headers from configure check > - use #include "config.h" instead of <config.h> > > HTH :) > > -- > Olivier Courtin > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/2003 |
From: Olivier C. <oli...@pn...> - 2003-12-14 19:10:26
|
Hi, As i wanted to play with xmlstarlet, i get several compilation warning. (gcc 3.2.3, linux 2.4.19, libxml 2.6.2, xmlstarlet CVS or 0.7.0) So i send you a patch with following changelog : ( notice that i'm not at all a c expert, so... ) 1) Remove Warning with -Wall -pedantic compilation : - usage string chunk -> 509 char min on ISO C90 2) Remove Warning with -Wall -ansi -pedantic compilation : - add ansi flag, and remove -g -> configure.in - snprintf convert as sprintf -> ANSI compliant - strdup implementation -> ANSI compliant - stat macro modification (xml_ls.c) -> POSIX compliant - lstat convert as stat -> ansi compliant 3) Remove LibXml API Warning : - SAX handler modification (xml_pyx.c) -> API libxml 2.6.2 - docbook support removed -> deprecated since libxml 2.6.0 API 4) User Friendly : - configure.in modification -> check libxml2 version >= 2.6.2 5) Tidy : - remove unused fonction and headers from configure check - use #include "config.h" instead of <config.h> HTH :) -- Olivier Courtin |
From: Mikhail G. <mgr...@co...> - 2003-11-29 21:06:05
|
http://fr2.rpmfind.net/linux/SuSE-Linux/suse/i386/9.0/suse/i586/xmlstarlet-0.5.1-21.i586.rpm http://fr2.rpmfind.net/linux/SuSE-Linux/suse/i386/9.0/suse/src/xmlstarlet-0.5.1-21.src.rpm ftp://ftp.cs.univ-paris8.fr/pub/linux/distributions/mandrake/9.2/contrib/i586/xmlstarlet-0.6.0-1mdk.i586.rpm ftp://ftp.cs.univ-paris8.fr/pub/linux/distributions/mandrake/9.2/contrib/SRPMS/xmlstarlet-0.6.0-1mdk.src.rpm --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003 |
From: Mikhail G. <mgr...@co...> - 2003-11-11 00:54:23
|
XMLStarlet Command Line XML Toolkit 0.7.0 = http://xmlstar.sourceforge.net/ XMLStarlet is a set of command line utilities (tools) which can be used = to transform, query, validate, and edit XML documents and files using = simple set of shell commands in similar way it is done for plain text = files using UNIX grep, sed, awk, diff, patch, join, etc commands. This set of command line utilities can be used by those who deal with = many XML documents on UNIX shell command prompt as well as for automated = XML processing with shell scripts. The toolkit's feature set includes options to:=20 a.. Check or validate XML files (simple well-formedness check, DTD, XSD, = RelaxNG)=20 a.. Calculate values of XPath expressions on XML files (such as running = sums, etc)=20 a.. Search XML files for matches to given XPath expressions=20 a.. Apply XSLT stylesheets to XML documents (including EXSLT support, = and passing parameters to stylesheets)=20 a.. Query XML documents (ex. query for value of some elements of = attributes, sorting, etc)=20 a.. Modify or edit XML documents (ex. delete some elements)=20 a.. Format or "beautify" XML documents (as changing indentation, etc)=20 a.. Fetch XML documents using http:// or ftp:// URLs=20 a.. Browse tree structure of XML documents (in similar way to 'ls' = command for directories)=20 a.. Include one XML document into another using XInclude=20 a.. XML c14n canonicalization=20 a.. Escape/unescape special XML characters in input text=20 a.. Print directory as XML document=20 a.. Convert XML into PYX format (based on ESIS - ISO 8879) and vice = versa=20 XMLStarlet command line utility is written in C and uses libxml2 and = libxslt from http://xmlsoft.org/.=20 Implementation of extensive choice of options for XMLStarlet utility was = only possible because of rich feature set of libxml2 and libxslt (many = thanks to the developers of those libraries for great work).=20 XMLStarlet is linked statically to both libxml2 and libxslt, so = generally all you need to process XML documents is one executable file. = To run XmlStarlet utility you can simple type 'xml' on command line and = see list of options available.=20 XMLStarlet is open source freeware under MIT license which allows free = use and distribution for both commercial and non-commercial projects.=20 We welcome any user's feedback on this project which would greatly help = us to improve its quality. Comments, suggestions, feature requests, bug = reports can be done via SourceForge project web site (see XMLStarlet = Sourceforge forums, or XMLStarlet mailing list) Changes: Changes since 0.6.0 1. Recompiled against recent libxml2-2.6.2 and libxslt-1.1.0 libraries=20 2. New binaries for Windows/Linux/=20 3. Additional examples and tests=20 4. Fixed few core dumps (esp. on Windows) a.. User Resources =20 Overview =20 Documentation =20 Download XmlStarlet =20 License (MIT) =20 a.. Developer Resources =20 XmlStarlet Source Code =20 XmlStarlet SourceForge Site =20 XmlStarlet CVS Source =20 XmlStarlet on Freshmeat.Net =20 --XMLStarlet Dev Team a..=20 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.537 / Virus Database: 332 - Release Date: 11/6/2003 |
From: Mikhail G. <mgr...@co...> - 2003-11-10 03:49:08
|
=20 XMLStarlet Command Line XML Toolkit 0.7.0 = http://xmlstar.sourceforge.net/ XMLStarlet is a set of command line utilities (tools) which can be used = to transform, query, validate, and edit XML documents and files using = simple set of shell commands in similar way it is done for plain text = files using UNIX grep, sed, awk, diff, patch, join, etc commands. This set of command line utilities can be used by those who deal with = many XML documents on UNIX shell command prompt as well as for automated = XML processing with shell scripts. The toolkit's feature set includes options to:=20 a.. Check or validate XML files (simple well-formedness check, DTD, XSD, = RelaxNG)=20 a.. Calculate values of XPath expressions on XML files (such as running = sums, etc)=20 a.. Search XML files for matches to given XPath expressions=20 a.. Apply XSLT stylesheets to XML documents (including EXSLT support, = and passing parameters to stylesheets)=20 a.. Query XML documents (ex. query for value of some elements of = attributes, sorting, etc)=20 a.. Modify or edit XML documents (ex. delete some elements)=20 a.. Format or "beautify" XML documents (as changing indentation, etc)=20 a.. Fetch XML documents using http:// or ftp:// URLs=20 a.. Browse tree structure of XML documents (in similar way to 'ls' = command for directories)=20 a.. Include one XML document into another using XInclude=20 a.. XML c14n canonicalization=20 a.. Escape/unescape special XML characters in input text=20 a.. Print directory as XML document=20 a.. Convert XML into PYX format (based on ESIS - ISO 8879) and vice = versa=20 XMLStarlet command line utility is written in C and uses libxml2 and = libxslt from http://xmlsoft.org/.=20 Implementation of extensive choice of options for XMLStarlet utility was = only possible because of rich feature set of libxml2 and libxslt (many = thanks to the developers of those libraries for great work).=20 XMLStarlet is linked statically to both libxml2 and libxslt, so = generally all you need to process XML documents is one executable file. = To run XmlStarlet utility you can simple type 'xml' on command line and = see list of options available.=20 XMLStarlet is open source freeware under MIT license which allows free = use and distribution for both commercial and non-commercial projects.=20 We welcome any user's feedback on this project which would greatly help = us to improve its quality. Comments, suggestions, feature requests, bug = reports can be done via SourceForge project web site (see XMLStarlet = Sourceforge forums, or XMLStarlet mailing list) Changes: Changes since 0.6.0 1. Recompiled against recent libxml2-2.6.2 and libxslt-1.1.0 libraries=20 2. New binaries for Windows/Linux/=20 3. Additional examples and tests=20 4. Fixed few core dumps (esp. on Windows) a.. User Resources =20 Overview =20 Documentation =20 Download XmlStarlet =20 License (MIT) =20 a.. Developer Resources =20 XmlStarlet Source Code =20 XmlStarlet SourceForge Site =20 XmlStarlet CVS Source =20 XmlStarlet on Freshmeat.Net =20 --XMLStarlet Dev Team a..=20 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.537 / Virus Database: 332 - Release Date: 11/6/2003 |
From: Mikhail G. <mgr...@co...> - 2003-11-06 05:07:27
|
Here is a script which can help you to compile XmlStarlet from released = source code: http://xmlstar.sourceforge.net/doc/run-xmlstarlet-build --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.525 / Virus Database: 322 - Release Date: 10/10/2003 |
From: Mikhail G. <mgr...@co...> - 2003-10-17 14:33:26
|
There is no such thing as defining namespace in XPath expression itself. There are some XPath functions local-name(), name() which can help you to work with prefixes, but the truth is: namespace is identified by its URI portion, that is why you have to define bindings prefix-URI for XPath. ----- Original Message ----- From: "Keith Beattie" <KSB...@lb...> To: "Shaun McCance" <sh...@gn...> Cc: <xml...@li...> Sent: Friday, October 17, 2003 5:09 AM Subject: Re: [Xmlstar-devel] c14n xpath > Well, I'm having trouble finding an introductory reference on xpath that > includes namespaces (I generally try to avoid starting with the spec but > it appears I don't have much of a choice here). But in the meantime... > > Shaun McCance wrote: > > The XPath expression isn't part of the XML document, so the namespace > > declarations in the XML document are irrelevant to the XPath expression. > > The prefix-namespace association has to be given to the XPath processor > > for a namespace prefix in an XPath to mean anything. > > Seems to me that the same be said about any element or attribute name. > > > You might wonder why an XPath processor can't just look at the prefixes > > used in the XML file and use the same ones. > > *Exactly* what I'm wondering! > > > Here's an example: > > > > <foo:foo xmlns:foo="http://example.com/foo"> > > <foo:bar/> > > <foo:bar xmlns:foo="http://example.com/foobar"/> > > </foo:foo> > > > > What would the XPath expression //foo:bar select? > > I guess I'd expect both foo:bar elements: > > <foo:bar/> > <foo:bar xmlns:foo="http://example.com/foobar"/> > > Which means that I'm assuming the absence of a namespace specification > means 'any namespace'. Bad assumption on my part apparently... :) > > So is it possible to provide these prefix-namespace associations in the > xpath expression itself? And not pass it in via (what appears to be the > out-of-band method of) the XPath element? For example, rather than: > > <XPath xmlns:foo="http://example.com/foo"> > //foo:bar > </XPath> > > something like: > > <XPath> > //foo:bar[ns::xmlns:foo="http://example.com/foo"> > </XPath> > > even though I know that's not the proper syntax. (I ask because I'm > working with another xpath implementation (in python) and using xmlstar > as a reference.) > > Thanks so much for your time. > ksb > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > SourceForge.net hosts over 70,000 Open Source Projects. > See the people who have HELPED US provide better services: > Click here: http://sourceforge.net/supporters.php > _______________________________________________ > xmlstar-devel mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlstar-devel --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.525 / Virus Database: 322 - Release Date: 10/9/2003 |
From: Keith B. <KSB...@lb...> - 2003-10-17 09:17:51
|
Well, I'm having trouble finding an introductory reference on xpath that includes namespaces (I generally try to avoid starting with the spec but it appears I don't have much of a choice here). But in the meantime... Shaun McCance wrote: > The XPath expression isn't part of the XML document, so the namespace > declarations in the XML document are irrelevant to the XPath expression. > The prefix-namespace association has to be given to the XPath processor > for a namespace prefix in an XPath to mean anything. Seems to me that the same be said about any element or attribute name. > You might wonder why an XPath processor can't just look at the prefixes > used in the XML file and use the same ones. *Exactly* what I'm wondering! > Here's an example: > > <foo:foo xmlns:foo="http://example.com/foo"> > <foo:bar/> > <foo:bar xmlns:foo="http://example.com/foobar"/> > </foo:foo> > > What would the XPath expression //foo:bar select? I guess I'd expect both foo:bar elements: <foo:bar/> <foo:bar xmlns:foo="http://example.com/foobar"/> Which means that I'm assuming the absence of a namespace specification means 'any namespace'. Bad assumption on my part apparently... :) So is it possible to provide these prefix-namespace associations in the xpath expression itself? And not pass it in via (what appears to be the out-of-band method of) the XPath element? For example, rather than: <XPath xmlns:foo="http://example.com/foo"> //foo:bar </XPath> something like: <XPath> //foo:bar[ns::xmlns:foo="http://example.com/foo"> </XPath> even though I know that's not the proper syntax. (I ask because I'm working with another xpath implementation (in python) and using xmlstar as a reference.) Thanks so much for your time. ksb |
From: Shaun M. <sh...@gn...> - 2003-10-17 02:57:19
|
The XPath expression isn't part of the XML document, so the namespace declarations in the XML document are irrelevant to the XPath expression. The prefix-namespace association has to be given to the XPath processor for a namespace prefix in an XPath to mean anything. You might wonder why an XPath processor can't just look at the prefixes used in the XML file and use the same ones. Here's an example: <foo:foo xmlns:foo="http://example.com/foo"> <foo:bar/> <foo:bar xmlns:foo="http://example.com/foobar"/> </foo:foo> What would the XPath expression //foo:bar select? -- Shaun On Thu, 2003-10-16 at 20:39, Keith Beattie wrote: > Thank you very much! > > I realize that this is somewhat off-topic but I'm suprised at the need > for the namespace declarations in the XPath element. The same info is > in the xml doc... Is this repetition something required by xpath or is > an artifact of xmlstar's or libxml's API? > > Any recommendations on good xpath docs, appreciated. > > Thanks, > ksb > > Mikhail Grushinskiy wrote: > > create a file called 'doc1.xpath' > > > > and put the following in there > > > > <?xml version="1.0"?> > > <XPath xmlns:n0="http://a.example.com" xmlns:n1="http://b.example"> > > (//. | //@* | //namespace::*)[ancestor-or-self::n1:elem1] > > </XPath> > > > > Your command will be the following > > > > xml c14n --exc-without-comments doc1.xml doc1.xpath > > > > which gives output > > > > <n1:elem1 xmlns:n1="http://b.example"> > > content > > </n1:elem1> > > > > Thanks for noticing this as it was totally undocumented. > > > > --Mikhail > > > > ----- Original Message ----- > > From: "Keith Beattie" <KSB...@lb...> > > To: <xml...@li...> > > Sent: Wednesday, October 15, 2003 3:03 PM > > Subject: [Xmlstar-devel] c14n xpath > > > > > > > >>Hello, > >> > >>Wonderfull little tool this is, though I've a questions about c14n and > >>xpath. > >> > >>I'm trying to work through the example of exclusinve c14n from the > >>exc-xmlc14n spec and xml doesn't seem to like the xpath expression. > >>Specifically: > >> > >>$ cat doc1.xml > >><n0:pdu xmlns:n0='http://a.example.com'> > >> <n1:elem1 xmlns:n1='http://b.example'> > >> content > >> </n1:elem1> > >></n0:pdu> > >> > >>$ xml c14n --without-comments doc1.xml '(//. | //@* | > >>//namespace::*)[ancestor-or-self::n1:elem1]' > >>warning: failed to load external entity > >> > > > > "(//.%20%7C%20//@*%20%7C%20//namespace%3A%3A*)%5Bancestor-or-self%3A%3An1%3A > > elem1%5D" > > > >>Error: unable to parse file "(//. | //@* | > >>//namespace::*)[ancestor-or-self::n1:elem1]" > >>Error: unable to evaluate xpath expression > >> > >>Am I doing something wrong here? > >> > >>Thanks, > >>ksb > >> > >> > >> > >>------------------------------------------------------- > >>This SF.net email is sponsored by: SF.net Giveback Program. > >>SourceForge.net hosts over 70,000 Open Source Projects. > >>See the people who have HELPED US provide better services: > >>Click here: http://sourceforge.net/supporters.php > >>_______________________________________________ > >>xmlstar-devel mailing list > >>xml...@li... > >>https://lists.sourceforge.net/lists/listinfo/xmlstar-devel > > > > > > > > --- > > Outgoing mail is certified Virus Free. > > Checked by AVG anti-virus system (http://www.grisoft.com). > > Version: 6.0.524 / Virus Database: 321 - Release Date: 10/6/2003 > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: SF.net Giveback Program. > > SourceForge.net hosts over 70,000 Open Source Projects. > > See the people who have HELPED US provide better services: > > Click here: http://sourceforge.net/supporters.php > > _______________________________________________ > > xmlstar-devel mailing list > > xml...@li... > > https://lists.sourceforge.net/lists/listinfo/xmlstar-devel > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > SourceForge.net hosts over 70,000 Open Source Projects. > See the people who have HELPED US provide better services: > Click here: http://sourceforge.net/supporters.php > _______________________________________________ > xmlstar-devel mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlstar-devel |
From: Keith B. <KSB...@lb...> - 2003-10-17 01:39:54
|
Thank you very much! I realize that this is somewhat off-topic but I'm suprised at the need for the namespace declarations in the XPath element. The same info is in the xml doc... Is this repetition something required by xpath or is an artifact of xmlstar's or libxml's API? Any recommendations on good xpath docs, appreciated. Thanks, ksb Mikhail Grushinskiy wrote: > create a file called 'doc1.xpath' > > and put the following in there > > <?xml version="1.0"?> > <XPath xmlns:n0="http://a.example.com" xmlns:n1="http://b.example"> > (//. | //@* | //namespace::*)[ancestor-or-self::n1:elem1] > </XPath> > > Your command will be the following > > xml c14n --exc-without-comments doc1.xml doc1.xpath > > which gives output > > <n1:elem1 xmlns:n1="http://b.example"> > content > </n1:elem1> > > Thanks for noticing this as it was totally undocumented. > > --Mikhail > > ----- Original Message ----- > From: "Keith Beattie" <KSB...@lb...> > To: <xml...@li...> > Sent: Wednesday, October 15, 2003 3:03 PM > Subject: [Xmlstar-devel] c14n xpath > > > >>Hello, >> >>Wonderfull little tool this is, though I've a questions about c14n and >>xpath. >> >>I'm trying to work through the example of exclusinve c14n from the >>exc-xmlc14n spec and xml doesn't seem to like the xpath expression. >>Specifically: >> >>$ cat doc1.xml >><n0:pdu xmlns:n0='http://a.example.com'> >> <n1:elem1 xmlns:n1='http://b.example'> >> content >> </n1:elem1> >></n0:pdu> >> >>$ xml c14n --without-comments doc1.xml '(//. | //@* | >>//namespace::*)[ancestor-or-self::n1:elem1]' >>warning: failed to load external entity >> > > "(//.%20%7C%20//@*%20%7C%20//namespace%3A%3A*)%5Bancestor-or-self%3A%3An1%3A > elem1%5D" > >>Error: unable to parse file "(//. | //@* | >>//namespace::*)[ancestor-or-self::n1:elem1]" >>Error: unable to evaluate xpath expression >> >>Am I doing something wrong here? >> >>Thanks, >>ksb >> >> >> >>------------------------------------------------------- >>This SF.net email is sponsored by: SF.net Giveback Program. >>SourceForge.net hosts over 70,000 Open Source Projects. >>See the people who have HELPED US provide better services: >>Click here: http://sourceforge.net/supporters.php >>_______________________________________________ >>xmlstar-devel mailing list >>xml...@li... >>https://lists.sourceforge.net/lists/listinfo/xmlstar-devel > > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.524 / Virus Database: 321 - Release Date: 10/6/2003 > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > SourceForge.net hosts over 70,000 Open Source Projects. > See the people who have HELPED US provide better services: > Click here: http://sourceforge.net/supporters.php > _______________________________________________ > xmlstar-devel mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlstar-devel |
From: Mikhail G. <mgr...@co...> - 2003-10-15 20:43:34
|
create a file called 'doc1.xpath' and put the following in there <?xml version="1.0"?> <XPath xmlns:n0="http://a.example.com" xmlns:n1="http://b.example"> (//. | //@* | //namespace::*)[ancestor-or-self::n1:elem1] </XPath> Your command will be the following xml c14n --exc-without-comments doc1.xml doc1.xpath which gives output <n1:elem1 xmlns:n1="http://b.example"> content </n1:elem1> Thanks for noticing this as it was totally undocumented. --Mikhail ----- Original Message ----- From: "Keith Beattie" <KSB...@lb...> To: <xml...@li...> Sent: Wednesday, October 15, 2003 3:03 PM Subject: [Xmlstar-devel] c14n xpath > Hello, > > Wonderfull little tool this is, though I've a questions about c14n and > xpath. > > I'm trying to work through the example of exclusinve c14n from the > exc-xmlc14n spec and xml doesn't seem to like the xpath expression. > Specifically: > > $ cat doc1.xml > <n0:pdu xmlns:n0='http://a.example.com'> > <n1:elem1 xmlns:n1='http://b.example'> > content > </n1:elem1> > </n0:pdu> > > $ xml c14n --without-comments doc1.xml '(//. | //@* | > //namespace::*)[ancestor-or-self::n1:elem1]' > warning: failed to load external entity > "(//.%20%7C%20//@*%20%7C%20//namespace%3A%3A*)%5Bancestor-or-self%3A%3An1%3A elem1%5D" > Error: unable to parse file "(//. | //@* | > //namespace::*)[ancestor-or-self::n1:elem1]" > Error: unable to evaluate xpath expression > > Am I doing something wrong here? > > Thanks, > ksb > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > SourceForge.net hosts over 70,000 Open Source Projects. > See the people who have HELPED US provide better services: > Click here: http://sourceforge.net/supporters.php > _______________________________________________ > xmlstar-devel mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlstar-devel --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.524 / Virus Database: 321 - Release Date: 10/6/2003 |
From: Keith B. <KSB...@lb...> - 2003-10-15 19:03:27
|
Hello, Wonderfull little tool this is, though I've a questions about c14n and xpath. I'm trying to work through the example of exclusinve c14n from the exc-xmlc14n spec and xml doesn't seem to like the xpath expression. Specifically: $ cat doc1.xml <n0:pdu xmlns:n0='http://a.example.com'> <n1:elem1 xmlns:n1='http://b.example'> content </n1:elem1> </n0:pdu> $ xml c14n --without-comments doc1.xml '(//. | //@* | //namespace::*)[ancestor-or-self::n1:elem1]' warning: failed to load external entity "(//.%20%7C%20//@*%20%7C%20//namespace%3A%3A*)%5Bancestor-or-self%3A%3An1%3Aelem1%5D" Error: unable to parse file "(//. | //@* | //namespace::*)[ancestor-or-self::n1:elem1]" Error: unable to evaluate xpath expression Am I doing something wrong here? Thanks, ksb |
From: Mikhail G. <mgr...@co...> - 2003-09-18 04:36:08
|
XMLStarlet Command Line XML Toolkit 0.6.0 = http://xmlstar.sourceforge.net/ XMLStarlet is a set of command line utilities (tools) which can be used = to transform, query, validate, and edit XML documents and files using = simple set of shell commands in similar way it is done for plain text = files using UNIX grep, sed, awk, diff, patch, join, etc commands. This set of command line utilities can be used by those who deal with = many XML documents on UNIX shell command prompt as well as for automated = XML processing with shell scripts. The toolkit's feature set includes options to:=20 a.. Check or validate XML files (simple well-formedness check, DTD, XSD, = RelaxNG)=20 a.. Calculate values of XPath expressions on XML files (such as running = sums, etc)=20 a.. Search XML files for matches to given XPath expressions=20 a.. Apply XSLT stylesheets to XML documents (including EXSLT support, = and passing parameters to stylesheets)=20 a.. Query XML documents (ex. query for value of some elements of = attributes, sorting, etc)=20 a.. Modify or edit XML documents (ex. delete some elements)=20 a.. Format or "beautify" XML documents (as changing indentation, etc)=20 a.. Fetch XML documents using http:// or ftp:// URLs=20 a.. Browse tree structure of XML documents (in similar way to 'ls' = command for directories)=20 a.. Include one XML document into another using XInclude=20 a.. XML c14n canonicalization=20 a.. Escape/unescape special XML characters in input text=20 a.. Print directory as XML document=20 a.. Convert XML into PYX format (based on ESIS - ISO 8879) and vice = versa=20 XMLStarlet command line utility is written in C and uses libxml2 and = libxslt from http://xmlsoft.org/.=20 Implementation of extensive choice of options for XMLStarlet utility was = only possible because of rich feature set of libxml2 and libxslt (many = thanks to the developers of those libraries for great work).=20 XMLStarlet is linked statically to both libxml2 and libxslt, so = generally all you need to process XML documents is one executable file. = To run XmlStarlet utility you can simple type 'xml' on command line and = see list of options available.=20 XMLStarlet is open source freeware under MIT license which allows free = use and distribution for both commercial and non-commercial projects.=20 We welcome any user's feedback on this project which would greatly help = us to improve its quality. Comments, suggestions, feature requests, bug = reports can be done via SourceForge project web site (see XMLStarlet = Sourceforge forums, or XMLStarlet mailing list) Changes: Changes since 0.5.1=20 1. Recompiled against recent libxml2-2.5.11 and libxslt-1.0.33 libraries = 2. New binaries for Windows/Solaris8-Sparc/Linux/=20 3. Additional examples and tests=20 4. Fixed few core dumps=20 a.. User Resources =20 Overview =20 Documentation =20 Download XmlStarlet =20 License (MIT) =20 a.. Developer Resources =20 XmlStarlet Source Code =20 XmlStarlet SourceForge Site =20 XmlStarlet CVS Source =20 XmlStarlet on Freshmeat.Net =20 --XMLStarlet Dev Team a..=20 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.516 / Virus Database: 313 - Release Date: 9/1/2003 |
From: Daniel S. <sh...@ir...> - 2003-08-29 16:55:22
|
I understand the need for the current semantic of --insert, but if I want to insert a node inside another node at the begining I need to do something like: xml ed -i "/node1/*[1]" -t elem -n "test" -v ... What if there is no node in node1? On the otherhand, subnode always adds at the end. I think we are missing something. I understand the need to refine the edit command, and I will try to think about how it should be implemented. Maybe I can give you some ideas. I agree that the edit feature should look alot like the sel feature. I think that edit could be a sel which is then inserted, appended etc... Why not have something like: xml ed .... sel .... We would evaluate the sel with exactly the select module and then paste/insert whatever the sel returned in the target XPath? I mean, for example incrementing an ID by one could also be implemented in the select module. There is no need for it to be only in the edit module? Daniel Shane -----Original Message----- From: xml...@li... [mailto:xml...@li...]On Behalf Of Mikhail Grushinskiy Sent: Friday, August 29, 2003 11:05 AM To: Daniel Shane; xml...@li... Subject: Re: [Xmlstar-devel] Great! insert - adds a node before selected node on same level append - adds a node after selected node on same level subnode - creates a child xml ed -i "/" -t elem -n "test" -v 5 does nothing. Actually command line options for 'edit' are not finalized. Some things are clearly missing. Ex. ability do add attributes together with element, ablility to modify nodes based on their current values. I pretty much realize what is missing, the main question is how to implement these missing functions so that it will be easir to use and it is still readable. I was also thinking about implementing 'edit' in similar approach to 'select' i.e. generate xpdate document based on command line options and implement xupdate see http://www.xmldb.org/xupdate/xupdate-wd.html ----- Original Message ----- From: "Daniel Shane" <sh...@ir...> To: <mgr...@co...>; <xml...@li...> Sent: Friday, August 29, 2003 10:05 AM Subject: RE: [Xmlstar-devel] Great! > Hehe! > > I'm still too new to this tool to fully understand all the combinations. > However, is it normal that the --insert inserts not "inside" the XPath but > "outside" of it? > > Ex. xml ed -i "/xml" -t elem -n "test" -v 5 > > this will add test before xml and not inside it. Then what should > > xml ed -i "/" -t elem -n "test" -v 5 > > do? > > Daniel Shane > > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.514 / Virus Database: 312 - Release Date: 8/28/2003 ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ xmlstar-devel mailing list xml...@li... https://lists.sourceforge.net/lists/listinfo/xmlstar-devel |
From: Mikhail G. <mgr...@co...> - 2003-08-29 15:10:15
|
insert - adds a node before selected node on same level append - adds a node after selected node on same level subnode - creates a child xml ed -i "/" -t elem -n "test" -v 5 does nothing. Actually command line options for 'edit' are not finalized. Some things are clearly missing. Ex. ability do add attributes together with element, ablility to modify nodes based on their current values. I pretty much realize what is missing, the main question is how to implement these missing functions so that it will be easir to use and it is still readable. I was also thinking about implementing 'edit' in similar approach to 'select' i.e. generate xpdate document based on command line options and implement xupdate see http://www.xmldb.org/xupdate/xupdate-wd.html ----- Original Message ----- From: "Daniel Shane" <sh...@ir...> To: <mgr...@co...>; <xml...@li...> Sent: Friday, August 29, 2003 10:05 AM Subject: RE: [Xmlstar-devel] Great! > Hehe! > > I'm still too new to this tool to fully understand all the combinations. > However, is it normal that the --insert inserts not "inside" the XPath but > "outside" of it? > > Ex. xml ed -i "/xml" -t elem -n "test" -v 5 > > this will add test before xml and not inside it. Then what should > > xml ed -i "/" -t elem -n "test" -v 5 > > do? > > Daniel Shane > > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.514 / Virus Database: 312 - Release Date: 8/28/2003 |
From: Mikhail G. <mgr...@co...> - 2003-08-29 14:44:55
|
No it is not possible right now ----- Original Message ----- From: "Daniel Shane" <sh...@ir...> To: <mgr...@co...>; <xml...@li...> Sent: Friday, August 29, 2003 10:08 AM Subject: Adding a node... > Is it possible with -i to add a node with an attribute at the same time? > > Ex: xml ed -i "/xml" -t elem -n "test" -v 5 -t attr -n "id" -v 5 > > Does not seem to work... > > Daniel Shane --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.514 / Virus Database: 312 - Release Date: 8/28/2003 |
From: Daniel S. <sh...@ir...> - 2003-08-29 14:03:50
|
Is it possible with -i to add a node with an attribute at the same time? Ex: xml ed -i "/xml" -t elem -n "test" -v 5 -t attr -n "id" -v 5 Does not seem to work... Daniel Shane |
From: Daniel S. <sh...@ir...> - 2003-08-29 14:00:42
|
Hehe! I'm still too new to this tool to fully understand all the combinations. However, is it normal that the --insert inserts not "inside" the XPath but "outside" of it? Ex. xml ed -i "/xml" -t elem -n "test" -v 5 this will add test before xml and not inside it. Then what should xml ed -i "/" -t elem -n "test" -v 5 do? Daniel Shane -----Original Message----- From: mgr...@co... [mailto:mgr...@co...] Sent: Thursday, August 28, 2003 3:37 PM To: xml...@li... Cc: Daniel Shane Subject: RE: [Xmlstar-devel] Great! Honestly I do not see much differences between element and attribute in that sense. (They are both nodes after all). Scenario you described can be achieved by combining multiple --insert, --append, --subnode which would look more natural and easier to read (I believe :)) --Mikhail > That works ok for attributes, but what if you want to update an XML node? In > that case would it be favorable to have multiple right hand side actions > before doing the affectation? In many cases the replacement is a > construction of elements rather than simply another part of the tree. > > Daniel Shane > > -----Original Message----- > From: xml...@li... > [mailto:xml...@li...]On Behalf Of > mgr...@co... > Sent: Thursday, August 28, 2003 2:54 PM > To: xml...@li... > Cc: Daniel Shane > Subject: RE: [Xmlstar-devel] Great! > > > Here is what was my original thinking on using XPATH expressions in r-values > for edit. > > Right now to update attribute value you would do something like > > xml ed -u //@id -v 2 > > //@id - points to a node being updated > 2 - specifies value (constant) > > > Here is how I would envision incremental update > > xml ed -u //@id -x "@id+1" > > //@id - points to a node/nodes being updated > and gives a context for xpath expressions > > @id+1 - specifies xpath expression within the context > defined in -u option. This expression evaluates > and its value is assigned to a node selected > in -u. > > Something like that... > > --Mikhail > > |
From: <mgr...@co...> - 2003-08-28 19:45:55
|
Honestly I do not see much differences between element and attribute in that sense. (They are both nodes after all). Scenario you described can be achieved by combining multiple --insert, --append, --subnode which would look more natural and easier to read (I believe :)) --Mikhail > That works ok for attributes, but what if you want to update an XML node? In > that case would it be favorable to have multiple right hand side actions > before doing the affectation? In many cases the replacement is a > construction of elements rather than simply another part of the tree. > > Daniel Shane > > -----Original Message----- > From: xml...@li... > [mailto:xml...@li...]On Behalf Of > mgr...@co... > Sent: Thursday, August 28, 2003 2:54 PM > To: xml...@li... > Cc: Daniel Shane > Subject: RE: [Xmlstar-devel] Great! > > > Here is what was my original thinking on using XPATH expressions in r-values > for edit. > > Right now to update attribute value you would do something like > > xml ed -u //@id -v 2 > > //@id - points to a node being updated > 2 - specifies value (constant) > > > Here is how I would envision incremental update > > xml ed -u //@id -x "@id+1" > > //@id - points to a node/nodes being updated > and gives a context for xpath expressions > > @id+1 - specifies xpath expression within the context > defined in -u option. This expression evaluates > and its value is assigned to a node selected > in -u. > > Something like that... > > --Mikhail > > |
From: Daniel S. <sh...@ir...> - 2003-08-28 19:26:43
|
That works ok for attributes, but what if you want to update an XML node? In that case would it be favorable to have multiple right hand side actions before doing the affectation? In many cases the replacement is a construction of elements rather than simply another part of the tree. Daniel Shane -----Original Message----- From: xml...@li... [mailto:xml...@li...]On Behalf Of mgr...@co... Sent: Thursday, August 28, 2003 2:54 PM To: xml...@li... Cc: Daniel Shane Subject: RE: [Xmlstar-devel] Great! Here is what was my original thinking on using XPATH expressions in r-values for edit. Right now to update attribute value you would do something like xml ed -u //@id -v 2 //@id - points to a node being updated 2 - specifies value (constant) Here is how I would envision incremental update xml ed -u //@id -x "@id+1" //@id - points to a node/nodes being updated and gives a context for xpath expressions @id+1 - specifies xpath expression within the context defined in -u option. This expression evaluates and its value is assigned to a node selected in -u. Something like that... --Mikhail > I did not put much thought yet but here is an idea... > > With the xml ed, we are actually replacing something with something else. So > the basic idea is xml ed -u "..." -x "..." where -u is the r-left and -x is > the r-right values. > > However, it is often difficult to construct an XPath for the r-value in one > statement. I was rather thinking something in the line of : > > xml ed -u "..." -r ...multiple statements... > > In multiple statements we must be able to match (-m), copy (-c), add a tag > (-e), get a value (-v), evaluate an XPath (-x), delete a tag (-d) and maybe > more. Each of these actions are "piped" together as usual, and the result of > the last command will be pasted in the l-value. I dont know what can happen > if you try to replace an attribute with an XML node instead of a value? > > Therefore we could do something like: > > xml ed -u "..." -r -m "/Record/Number" -v "node()" -x "some XPath that adds > 1 to the -v" ... > > This example is obvisouly overkill for what it does. > > Daniel Shane > > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ xmlstar-devel mailing list xml...@li... https://lists.sourceforge.net/lists/listinfo/xmlstar-devel |