moveon
10-01-2002, 08:49 AM
Hello everyone.
I am new to XML, and here I am trying to construct some kind of catelog modelling a shop.
If I put the link of a picture as an attribute in my XML file, how would I transform it into an attribute of an image tag with XSLT. So I would like to render my XML file into XSLT. This is something I have:
<product imgsrc="1.jpg">
<Name>Crap</Name>
...
</product>
And I would like to take this link, "1.jpg", and put it as an image in the xhtml file generated by XSLT.
In addition, I have no idea of what to put as element and what to put as attribute. This is a rough list of things that I have for my XML:
catelog, product (w/ ID, name, imgsrc, description, category, availability, width/height i.e. dimension)
ID would be an attribute to the product tag, but what about category and availability? It seems that avail. can be denoted by a number, say 0 and 1, and the user doesn't necessarily need to know what the code stands for. As name is an element, show category be an element too?
Finally, should width/height be elements of the dimension tag, as elements of just the product tag, or width/height be attributes to the dimension tag (which is an element of product)?
Thank you very much, and I look foward to some suggestions.
I am new to XML, and here I am trying to construct some kind of catelog modelling a shop.
If I put the link of a picture as an attribute in my XML file, how would I transform it into an attribute of an image tag with XSLT. So I would like to render my XML file into XSLT. This is something I have:
<product imgsrc="1.jpg">
<Name>Crap</Name>
...
</product>
And I would like to take this link, "1.jpg", and put it as an image in the xhtml file generated by XSLT.
In addition, I have no idea of what to put as element and what to put as attribute. This is a rough list of things that I have for my XML:
catelog, product (w/ ID, name, imgsrc, description, category, availability, width/height i.e. dimension)
ID would be an attribute to the product tag, but what about category and availability? It seems that avail. can be denoted by a number, say 0 and 1, and the user doesn't necessarily need to know what the code stands for. As name is an element, show category be an element too?
Finally, should width/height be elements of the dimension tag, as elements of just the product tag, or width/height be attributes to the dimension tag (which is an element of product)?
Thank you very much, and I look foward to some suggestions.