leafref referencing across modules

160 views
Skip to first unread message

ingwhe...@gmail.com

unread,
Apr 28, 2015, 4:37:19 PM4/28/15
to libne...@googlegroups.com
Hello,

My apologies in advance if this is bone-headed post.

I was wondering if using leafref in one module to reference a node in a different module is supported. I've attached two YANG modules that I used for testing, and their corresponding schematron stylesheets.

From the output I have, it looks like there isn't enough information for the schematron stylesheet to perform this type of validation, where there's referencing across modules.

The output I have shows that when schematron stylesheet is applied during validation in xsltApplyStylesheet() , the xmlDoc is contains data only from module leafrefs2. However, the schematron stylesheet for module leafrefs2 doesn't have information about module leafrefs.

So, is it my fault or is this an issue in libnetconf?

Thanks,
Helen

P.S. When I tried to configure leafrefs2's l4 using this RPC:

<?xml version="1.0" encoding="UTF-8"?>
<rpc message-id="106"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
xmlns:l="http://example.com/leafrefs"
xmlns:l2="http://example.com/leafrefs2">
<edit-config>
<target>
<running />
</target>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
<l2:l4 xmlns:l="http://example.com/leafrefs">
<l2:id>1</l2:id>
<l2:l1-ref>abc</l2:l1-ref>
</l2:l4>
</config>
</edit-config>
</rpc>
]]>]]>

A snippet of what I believe to be the relevant libxslt output:

xsltProcessOneNode: applying template '/nc:data/l2:l4/l2:l1-ref' for l1-ref
xsltApplySequenceConstructor: copy node fired-rule
xsltIf: test not($root/l:l1/l:name=.)
Lookup variable 'root'
found variable 'root'
XPath error : Undefined namespace prefix
xsltIf: test evaluate to -1
leafrefs.yang
leafrefs2.yang
leafrefs-schematron.xsl
leafrefs2-schematron.xsl

Radek Krejčí

unread,
Apr 29, 2015, 4:09:17 AM4/29/15
to ingwhe...@gmail.com, libne...@googlegroups.com
Hi Helen,

you are completely right, this feature is not supported by libnetconf. We have currently a work with higher priority, but I've created an issue (#58) and I would like to explore this issue more later. It is possible, that we will postpone the issue to the libnetconf2 (libyang) which should implement validation internally without need for schematron or relagng.


Best regards,
Radek


Dne 28.4.2015 v 22:37 ingwhe...@gmail.com napsal(a):
Reply all
Reply to author
Forward
0 new messages