Dne 08. 04. 20 v 13:33 josef Reidinger napsal(a):

For me it looks like overengineering. Do we plan to have multiple namespaces (
like element namespaces to distinguish sub elements ) or combine multiple XML
files? Now we have XML with simple structure and ignoring anything that does not
have namespace is just another obstacle for me. Especially when you need to 
define
namespace when you write file ( visible in test suite as currently
`Yast::XML.XMLToYCPString(Yast::XML.YCPToXMLString("test", {"test" => 15}))`
returns => {}

[...]

I see many xmls that do not have namespace and works OK. as long as you do not
mixture different types of xmls (e.g. try some xmls in /usr/share - wicked, gdb,
libvirt, gimp they do not use namespaces )


Disclaimer: I'm not an XML expert so take my opinions with a grain of salt...

The namespaces are useful if you need to merge several different XML parts into 
one
document. You can have customer.xml and order.xml containing the same tag, 
let's say
<id>. If you merge them with namespaces you can still easily differ between
<customer:id> and <order:id> and avoid ambiguity.

A perfect example is XSL transformation which describes how to transform one XML
document into another XML. And it's written, surprisingly, also in XML.
Then with namespaces you can easily avoid conflicts between the literal XML
input/output data and the XSL metadata describing the transformation itself.

But the question is: do we need something like this for YaST? Is there any use 
case
for that? I have never seen a need for anything like that...

For me personally the YaST namespaces just make the things more difficult. E.g. 
if
you need to define a XSL transformation for a control.xml you need to be 
careful to
correctly match the input namespaces in tags and make sure no extra namespace is
printed in the output.

See e.g.
https://github.com/yast/skelcd-control-SLES4SAP/blob/master/package/installation.SLES4SAP.xsl


So I think I could live without the namespaces, but as we are not much familiar with XML then my suggestion is to ask some real XML expert. Do you know some? Do we have one?

--
Ladislav Slezák
YaST Developer

SUSE LINUX, s.r.o.
Corso IIa
Křižíkova 148/34
18600 Praha 8
--
To unsubscribe, e-mail: yast-devel+unsubscr...@opensuse.org
To contact the owner, e-mail: yast-devel+ow...@opensuse.org

Reply via email to