473,513 Members | 2,425 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create Netlist Hierarchy with XSLT

Dear All,

may be some one has a good idea for the follwoing problem.

In the xml data below you see a kind of abstract netlist as we use it
for chip design. Where the H tag stands for a logical hierarchy level,
the M tag for a physical macro and the p tag for a pin of the macro
which has to be bound to a Net ( named by @Net).
The existing netlist is described without the Hierarchy. Hence, I must
know which nets I have to pass trough the Hierarchy interface (H
tags).

Imagine I'm on the node <H id=5>
Then all nets which are above are ancestor::*/M/p/@Net
The Nets in and below this Level are decendant::*/p/@Net

What I would need is a list of Nets which are in the ancestor nets AND
in the decendant nets. This nets are exactly the ones we need in the
interface.

ancestor::/M/p[@Net=descedant::*/p]/@Net does not return any net.
I feel the approach to have = betwenn to nodesets may be bad.

What is the right solution here ???
I would expect the Nets A,C and D

Thanks a lot for your help
Rolf

########################## DATA ############################
<TOP>
<H id="1">
<M id="2">
<p net="A"/>
<p net="B"/>
<p net="E"/>
</M>
<H id="3">
<M id="4">
<p net="C"/>
<p net="B"/>
</M>
<H id="5">
<M id="6">
<p net="D"/>
<p net="C"/>
</M>
<H id="7">
<M id="8">
<p net="A"/>
<p net="C"/>
</M>
</H>
</H>
<M id="9">
<p net="D"/>
<p net="A"/>
</M>
<H id="10">
<M id="11">
<p net="B"/>
<p net="E"/>
</M>
</H>
<M id="12">
<p net="E"/>
<p net="B"/>
</M>
</H>
</H>
</TOP>
Jul 20 '05 #1
1 1430
Hi,

Tempore 00:16:15, die Thursday 13 January 2005 AD, hinc in foro {comp.text.xml} scripsit Rolf Kemper <Ke*****@ee.nec.de>:
Imagine I'm on the node <H id=5>
Then all nets which are above are ancestor::*/M/p/@Net
The Nets in and below this Level are decendant::*/p/@Net

What I would need is a list of Nets which are in the ancestor nets AND
in the decendant nets. This nets are exactly the ones we need in the
interface.

ancestor::/M/p[@Net=descedant::*/p]/@Net does not return any net.
I feel the approach to have = betwenn to nodesets may be bad.

IMHO, that approach is perfect, in fact the solution is very close.

The following Xpath will return 'ACDA':
ancestor::*/M/p/@net[.=current()/descendant::*/p/@net]

While this Xpath will return exactly 'ACD', your desired output:
ancestor::*/M/p/@net[.=current()/descendant::*/p/@net][not(ancestor::[position() &gt; 3]/M/p/@net=.)]

regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-v...i?userid=38041)
Deserta faciunt et innovationem appelant
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3695
by: poofpoof | last post by:
Dear Experts, I have some problems with XSLT recursivity... here what I want to do XML part : ---------- <struct>
10
2076
by: KemperR | last post by:
Dear All, may be some of you can help me with an XSLT example how to solve the following challange. For the XML below I want to find out the maximum hierarchy level for a specific element in my...
7
5386
by: gsoftwares | last post by:
Hi XML Guru, I need to transform flat xml to Hierarchy xml. Can some one help me get started or have a same code with them my flat xml: <rowset> <row>
7
5193
by: pintihar | last post by:
Hi, As a follow on from an earlier post I have another question about xslt. Is it possible to create the stylsheet programatically? Is this sensible? In the first phase I needed to map element...
5
1979
by: mlev | last post by:
I want function in one namespace to create instance of class defined in another namespace. (more detailed - I try to make independent "Seralizer" dll, to be used by different application, each...
2
3066
by: Jonny | last post by:
Hi; I have a spice netlist contain capacitors, resistors, and mosfets. I want to store the componets in a graph so I can perform the following actions. 1. Check whether or not the network...
8
1666
by: Bostonasian | last post by:
I don't even know where to begin this as hierarchy is always confusing to construct dynamically in any form(query, xslt,etc). However it is very easy to follow when it's presented. I've done...
3
18681
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
4
2747
by: mark4asp | last post by:
I want to write a xslt template to create a xhtml 1.0 (transitional) file which will be sent in as email. Here is a typical xml data file: <BatchEmail> <Domain>www.myDomain.com</Domain>...
0
7264
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7166
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7386
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7543
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7106
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5689
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3236
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3226
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.