XML doesn’t have format info, so how could I format it into nice UI? Any best practice?
And what’s the pros and cons of using xml to present pages?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Two takes on this:
You can generate HTML as XHTML, which is approximately HTML that is well-formed (google on this separately for the differences). You can generate the XHTML like you generate other XML docs, but its more messy as you still need to include the styling/formatting elements.
Or:
Generate XML for content, then apply an XSLT transformation to turn this into HTML. Once you’ve done the stylesheet once it should be fairly re-usable.
Browsers such as IE will display XML directly, but they are basically doing the latter of the above options – applying a standard stylesheet to render the xml as html (and adding the +- buttons and so on). Its not in a format that the average Joe would follow though.
Hope this helps.