Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

XSLT transform XML document to display two columns from right to left

Hello,

I am trying to create XSLT output that will style XML to the following criteria. I have been stuck on this for several days please help.

1. Only display a field and table row if a value is present in the XML
2. Display only two column table
3. Display the data from left to right only if a value is present

Please see sample XML, XSLT, current output table and desired output table.

Thanks in advance,

Matthew

[b]Current XML - Employees.xml[/b]
[code]
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="Employees.xslt"?>


Smith
John
David
Jr.
101 Oak
Peoria
AZ
85345


Johnson
Mark

Sr.
105 Blue
New Albany
IN
70005


Walker
Jimmy
Frank


CA
90052


[/code]

[b]Current - Employees.xslt[/b]
[code]
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
<!ENTITY copy "©">
<!ENTITY reg "®">
<!ENTITY trade "™">
<!ENTITY mdash "—">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY pound "£">
<!ENTITY yen "¥">
<!ENTITY euro "€">
]>









( of  records found)






First Name:



Last Name:





Middle Name:



Generation:





Address:



City:





State:



Zip:







[/code]


[b]Current table output[/b]
[code]



First Name: John


Last Name: Smith




Middle Name: Middle Name:David


Generation: Generation:Jr.




Address: Address:101 Oak


City: Peoria




State: AZ


Zip: 85345








First Name: Mark


Last Name: Johnson




Middle Name:


Generation: Sr.




Address: 105 Blue


City: New Albany




State: IN


Zip: 70005








First Name: Jimmy


Last Name: Walker




Middle Name: Frank


Generation:




Address:


City:




State: CA


Zip: 90052



[/code]

[b]Desired table output[/b]
[code]



First Name: John


Last Name: Smith




Middle Name: David


Generation: Jr.




Address: 101 Oak


City: Peoria




State: AZ


Zip: 85345








First Name: Mark


Last Name: Johnson




Generation: Sr.


Address: 105 Blue




City: New Albany


State: IN




Zip: 70005










First Name: Jimmy


Last Name: Walker




Middle Name: Frank


State: CA




Zip: 90052





[/code]


Sign In or Register to comment.