Greetings,
With XMLports, how can I define that an element is to be printed, more than once, depending of the number of relations on other table?
Example:
(...)
<name> [1,1]
<idNumber> [1,1]
<comment> [0,n]
(...)
the element <comments> needs to be filled from another table where the comments are defined (for instance by idNumber table key).
The desirable result of the genarated file is:
(...)
<name>John Smith</name>
<idNumber>9999999</idNumber>
<comment>comment 1</comment>
<comment>comment 2</comment>
<comment>comment 3</comment>
(...)
Anyone can help me please??
Thank you very much!!
Comments
The problem is that the elements <comment> cant be idented.
the only thing that i am able to do is something like:
<comments>
--<comment>comment 1</comment>
</comments>
<comments>
--<comment>comment 2</comment>
</comments>
where tag <comments> is defined as the table of comments with linktable and linkfields related by idNumber of the table of Persons, and comment defined as the field comment of table comments.
The struture i need to follow is
<comment>comment 1</comment>
<comment>comment 2</comment>
This way, where do i have to define the comment table and link fields without identation?
I hope you understand what my problem is
Thank you very much
http://www.mibuso.com/forum/viewtopic.p ... xml+indent
edit: let us know if you need any help combining the two
This problem is similar to mine but not quite the same.
the diference is that i dont have a parent node to be defined as table. It seems to me that i would need the same element to be defined as table and field :shock:
<parentNode>
--<name>John Smith</name> [field of table of Persons]
--<idNumber>9999</idNumber> [field of table of Persons]
--<comment>comment 1<comment> [field of table of Comments]
--<comment>comment 2<comment> [field of table of Comments]
--(...)
</parentNode>
where comment 1 and comment 2 are comments in a table of comments linked by idNumber.
Table Persons -> key = idNumber
Table Comments -> key = idNumber,Comment
Is this possible with XMLports? If not, is there a way to do this with XMLDom?
Thx a lot all!!
Yes you can accomplish this through XMLports + XMLDom. (I suppose you overlooked what I said right above your latest post )
Hi there!
Hi didnt overlooked your last post Xypher, i just wanted to be certain you got my idea
So, can you give me any help on how i could to that?
convert the XML generated by my XMLPort
<name>John Smith</name>
<comments>
--<comment>comment 1</comment>
<comments>
<comments>
--<comment>comment 2</comment>
</comments>
(...)
to
<name>John Smith</name>
<comment>comment 1</comment>
<comment>comment 2</comment>
(...)
Thx a lot one more time!
Let me know if you have any difficulties with this.
Cheers!
I will try it soon!
Then, i come here to tell you something...
I think i'll have to generate my whole XML file through code.
Can you guys direct me to a nice NAV XMLDom Tutorial please?
Thx!