You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Stefano Orselli <st...@postecom.it> on 2006/07/05 09:29:33 UTC

Re: Betwixt: numbered tags for an array

Hi mike,
thanks for your mail!
and excuse me for the delay in my response.
your explanation is very complete, but i have other 2 question for you:

1.
if i use your third solution and i have 3 name, i have this xml:
<person>
    <name order="1">Aname</name>
    <name order="2">Bname</name>
    <name order="3">Cname</name>
</person>
how can i get a specific name, for example the second name('Bname')?
In your example you write:
    To get order:  /person/name/@order
    To get name: /person/name
but this not find a specific name.
But i have some problem in xsl-fo because i have 3 separate field in my pdf 
output, where i put the first, the second and the third name.

2.
with betwixt how can i write the attribute order in an element: for example 
<name order="1">

thanks and ciao
Stefano





----- Original Message ----- 
From: "Mike Sparr - www.goomzee.com" <mi...@goomzee.com>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
Sent: Wednesday, June 28, 2006 5:41 PM
Subject: Re: numbered tags for an array


> Here are 3 ways you could form the XML (also potential xpath syntax - 
> don't
> quote me on the attribute lookup w/ @ symbol - it's been a while and you 
> may
> just write element@attribute instead of adding the slash 
> element/@attribute?
> - it should get you close):
>
> <person order="1">
>  <name>Aname</name>
> </person>
>
> To get order:  /person/@order
> To get name: /person/name
>
> ...
>
> <person>
>  <name>Aname</name>
>  <order>1</order>
> </person>
>
> To get order:  /person/order
> To get name: /person/name
>
> ...
>
> <person>
>  <name order="1">Aname</name>
> </person>
>
> To get order:  /person/name/@order
> To get name: /person/name
>
> ------
>
> I think it's purely preference on how you design your XML as long as it's
> well-formed.  You'll have to read between the lines when people give you
> examples as there will be typos but you can understand what they meant...
> If my syntax above is incorrect, at least you can see what I was trying to
> do and make the syntax correct...  :)
>
> Hope this helps!
>
>
> Mike
>
>
>
> On 6/28/06 9:22 AM, "Mike Sparr - www.goomzee.com" <mi...@goomzee.com> 
> wrote:
>
>> <order>1</name> was just a typo and not well-formed XML...  The point he 
>> was
>> trying to make is to have some other element with your numbering or you
>> could also have an attribute with the name tag:
>>
>> <person>
>>   <name order="1">Aname</name>
>> </person>
>> <person>
>>   <name order="2">Bname</name>
>> </person>
>> ...
>>
>> Cheers,
>>
>>
>> Mike
>>
>>
>> On 6/28/06 9:23 AM, "Stefano Orselli" <st...@postecom.it> 
>> wrote:
>>
>>> Thank Fabian
>>> i don't understand the tag: <order>1</name>
>>> start with order and finish with name? Which type of variable have this
>>> characteristic in java?
>>> This type of indentation don't resolva my problem with xsl-fo where i 
>>> select
>>> a single field with: person/name
>>> If you have some response write me!
>>> Ciao
>>> Stefano
>>> ----- Original Message -----
>>> From: "Fabian Sergio de Rosa" <fd...@gmail.com>
>>> To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
>>> Sent: Wednesday, June 28, 2006 3:15 PM
>>> Subject: Re: numbered tags for an array
>>>
>>>
>>>> i think that's to hard to make
>>>> test if you can
>>>>
>>>> <person>
>>>>  <name>Aname</name>
>>>>  <order>1</name>
>>>> </person>
>>>> <person>
>>>>  <name>Anothername</name>
>>>>  <order>2</name>
>>>> </person>
>>>>
>>>> that's most easy to do and most easy to map and understand.
>>>>
>>>>
>>>> 2006/6/28, Stefano Orselli <st...@postecom.it>:
>>>>>
>>>>> Hi to all!
>>>>> I've a problem.
>>>>> I transform a bean to an xml file, and after i process this xml file 
>>>>> with
>>>>> fop.
>>>>> I've an array (or a collection) but when i create (via betwixt) the 
>>>>> xml
>>>>> file
>>>>> i find all the tags for the array value without numeration:
>>>>> example
>>>>> ......
>>>>> <name>Francesca</name>
>>>>> <name>Stefano</name>
>>>>> <name>Massimo</name>
>>>>> ......
>>>>> but for a lot of reasons i want numbered tags:
>>>>> example
>>>>> ......
>>>>> <name1>Francesca</name1>
>>>>> <name2>Stefano</name2>
>>>>> <name2>Massimo</name2>
>>>>> ......
>>>>> is there a solution?
>>>>> Thanks
>>>>> Ciao
>>>>> Stefano
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>>>
>>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org