• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

From Transformation perspective:Elements Vs Attributes

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have to design xml representing database which will be used in
1. transfer data back and forth to database
2. use series of transformation and display as PDF
Which representation is better from

or

Which one is better/easier while doing transformation.
Thanks and Regards,
Kartik
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From an XSLT stand-point, it doesn't matter.
When writing your style sheet, you have equal(?)
access to both elements and attributes.
Although, if the accountNumber has a lot of
cross-references, then you are better of taking
an attribute approach. This way you can
define your keys on this attribute and pull up
the account elements in a faster manner.
Also, an accountNumber defines a property of an
account, so you probably should go with the
attribute approach. When I say that, I am treating
the accountNumber like an ID attribute of an
element.
Hope this helps.
- m
 
Kartik Shah
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Madhav.
Yes, I would agree that both should have equal access using xslt.
1. What about the complexity of xslt ?
2. What about performance of transformation ?
I think it depends on how the transformation processor is going to work and how it traverses document.
I am trying to achieve following transformation
XML --> XML --> PDF
1. First transformation ( using xsl) is just changing the XML so that PDF can be generated easily using XSL-FO
Regards,
Kartik
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic