Mailinglist Archive: yast-devel (129 mails)

< Previous Next >
[yast-devel] SCR Agent: any-XML Parser
  • From: Lukas Ocilka <lukas.ocilka@xxxxxxx>
  • Date: Fri, 16 Nov 2007 18:34:25 +0100
  • Message-id: <473DD4A1.9020905@xxxxxxx>

I'd like to announce moving the *anyxml* SCR agent to *yast2.rpm*. This
has been done because not only yast2-packager but also yast2-users found
it suitable for parsing generic XML (see bugzilla #332187).

What is this XML parser good for?
It uses Perl module XML::Bare so it can parse every valid XML content,
not only YaST-specific formats.

Where can I find it?
In yast2-2.16.11.rpm and later.

How can I use it?

Is that new feature? Do we use it anywhere else?
No, anyxml is in openSUSE since 10.3. We use it for Online Repositories.

--- anyxml.ycp ---
any xml = SCR::Read (.anyxml, "any.xml");

y2milestone ("XML: %1", xml);
--- anyxml.ycp ---

--- any.xml ---
<?xml version="1.0"?>
<title>Learn YCP in 20 Minutes</title>
--- any.xml ---

Run: `/sbin/yast2 ./anyxml.ycp`
and see the result in y2log...

--- result in y2log ---
test/anyxml.ycp:4 XML: $[
"value":"Learn YCP in 20 Minutes"
"value":"\n\t "
"value":"\n "
--- result in y2log ---

author_firstname = foo["book","author","firstname","value"]:"Unknown";

Have a nice day


Lukas Ocilka, YaST Developer (xn--luk-gla45d)
SUSE LINUX, s. r. o., Lihovarska 1060/12, Praha 9, Czech Republic

< Previous Next >
This Thread
  • No further messages