Re: [v3 1/3] rng: Allow template inclusion in install scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 20, 2013 at 11:59:58PM +0200, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak@xxxxxxxxx>
> 
> Sometimes we'll have a lot in common between rather long templates of
> different OSs. To be able to share the templates, we need a way to
> include templates from one XML file to another.
> 
> XInclude[1] is the way we achieve that.
> 
> http://www.w3.org/TR/xinclude/
> ---
>  data/schemas/libosinfo.rng | 27 ++++++++++++++++++---------
>  osinfo/osinfo_loader.c     |  9 +++++++++
>  2 files changed, 27 insertions(+), 9 deletions(-)
> 
> diff --git a/data/schemas/libosinfo.rng b/data/schemas/libosinfo.rng
> index 90b0dfb..5852652 100644
> --- a/data/schemas/libosinfo.rng
> +++ b/data/schemas/libosinfo.rng
> @@ -579,15 +579,24 @@
>              <ref name='bool'/>
>            </element>
>          </optional>
> -        <element name='template'>
> -          <choice>
> -            <group>
> -              <attribute name="uri"/>
> -              <empty/>
> -            </group>
> -            <ref name="customElement"/>
> -          </choice>
> -        </element>
> +        <choice>
> +          <element name='template'>
> +            <choice>
> +              <group>
> +                <attribute name="uri"/>
> +                <empty/>
> +              </group>
> +              <ref name="customElement"/>
> +            </choice>
> +          </element>
> +          <element name='xi:include' xmlns:xi="http://www.w3.org/2001/XInclude";>
> +            <interleave>
> +              <attribute name="href"/>
> +              <attribute name="parse"/>
> +              <attribute name="xpointer"/>
> +            </interleave>
> +          </element>
> +        </choice>
>          <ref name='product-attr'/>
>          <ref name='product-rel'/>
>        </interleave>

Did you try
diff --git a/test/test-xml-validate b/test/test-xml-validate
index a2d20b4..9fb8534 100755
--- a/test/test-xml-validate
+++ b/test/test-xml-validate
@@ -16,7 +16,7 @@ do
   for xml in `echo "$XML" | sort`
   do
     n=`expr $n + 1`
-    cmd="xmllint --relaxng $SCHEMA --noout $xml"
+    cmd="xmllint --xinclude --relaxng $SCHEMA --noout $xml"
     result=`$cmd 2>&1`
     ret=$?

plus adding a call to xmlXIncludeProcessFlags in
tests/osinfo-db-validate.c:parse_file?
This would seem better to me as this would validates the document with the
XInclude substituted.

Christophe

Attachment: pgpjyiYlzsh22.pgp
Description: PGP signature

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux