473,324 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Some sort of xsl embedded in xml?

12
I wish to find some leads here.
My desire is such - to define a UI of some sort by XML (similar to xaml with c#).
I have a known xml elements / attributes and order.
I also have another xml, that contains data.
I wish to use conditions in my ui.xml that defines attribute's values according to the data.xml.
example:
ui.xml:
Expand|Select|Wrap|Line Numbers
  1. <root>
  2. <item title="if data/gender = 'female': Ms.; else: Mr." />
  3. </root>
data.xml:
Expand|Select|Wrap|Line Numbers
  1. <data>
  2. <gender>male</gender>
  3. </data>
So, in my very simple example, I want to somehow mix the two and get:

result.xml:
Expand|Select|Wrap|Line Numbers
  1. <root>
  2. <item title="Mr." />
  3. </root>
I know xsl is a known language for conditions on xml, that outputs html or xml (just by reading in the internet, not by known experience).
Of course, the language of the condition is something I made up, and that is what I seek. Something with a known interpreter / behavior that I can rely on, instead of doing something from scratch.
any help would be very appreciated.
Thanks.
Oct 28 '13 #1

✓ answered by Dormilich

I know xsl is a known language for conditions on xml, that outputs html or xml
XSL is not just conditions, it’s a programming language that transforms an XML document into something other (XML, HTML, Text, PDF, to name only the most common ones)

Of course, the language of the condition is something I made up, and that is what I seek. Something with a known interpreter / behavior that I can rely on, instead of doing something from scratch.
you can use any programming language (including XSL) to resolve the condition.
there are two principal approaches:
- read the XML as a data structure (requires that the language can actually load XML)
- read the XML as text

how to do that exactly depends (obviously) on the language used.

4 1277
Dormilich
8,658 Expert Mod 8TB
I know xsl is a known language for conditions on xml, that outputs html or xml
XSL is not just conditions, it’s a programming language that transforms an XML document into something other (XML, HTML, Text, PDF, to name only the most common ones)

Of course, the language of the condition is something I made up, and that is what I seek. Something with a known interpreter / behavior that I can rely on, instead of doing something from scratch.
you can use any programming language (including XSL) to resolve the condition.
there are two principal approaches:
- read the XML as a data structure (requires that the language can actually load XML)
- read the XML as text

how to do that exactly depends (obviously) on the language used.
Oct 28 '13 #2
bonjo
12
And how to I "tell" the xsl-to-xml engine to read an xml file and evaluate its attributes, where it indeed contains xsl code? is that possible? (in the form I supplied)

Im doing the entire programming in JAVA, in case there're other approaches.
I started thinking about using handlebars.java as a templating engine, and then simply read the input file as an xml, re-writing it while evaluating its attributes with handlebars.
sadly, all those mustache kinds are logic-less, and I need logic.

Thank you for your help
Oct 28 '13 #3
Dormilich
8,658 Expert Mod 8TB
And how to I "tell" the xsl-to-xml engine to read an xml file and evaluate its attributes, where it indeed contains xsl code?
this is language-specific. you should ask that in the forum of your language (Java Forum).
Oct 28 '13 #4
bonjo
12
Well, you're right. Sorry for targeting it from one subforum to the other.
I will continue my journey there.
have a good day
Oct 28 '13 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: DJ Craig | last post by:
I use a web hosting service that gives me FTP access to my directory on a Linux server. I use Mac OS X. I write my code in Dreamweaver MX which gives me color-coding, but I get really tired of...
4
by: Bernard A. | last post by:
hello, i'm looking for a way to have all possible length fixed n-uples from a list, i think generators can help, but was not able to do it myself, maybe some one could point me out to an idea to...
2
by: phoenix | last post by:
Hi, I wonder if the following is even possible : Suppose I have a page with a set of hyperlinks on it. Each time a hyperlink is clicked a new window is opened. What i basically want is the...
4
by: deancoo | last post by:
I'm looking for an STL algorithm similar to 'copy', but not needing the target container to have elements available to copy into (a 'valid range'). What I need to do is something simple like, take...
2
by: NAJH | last post by:
I have three tables: tblBook has the fields bookID, bookRangeID, bookSubjectID, bookCode tblBookRange has the fields bookRangeID, bookRangeDescription tblBookSubject has the fields...
0
by: Stefan Turalski \(stic\) | last post by:
Hi, What I do is looking for holes in my solution to problem which is: 1. taking something from database by this sth ID, by some application 2. process it to this multithread enviroment of some...
2
by: Jensen bredal | last post by:
Hello, I'm quiet confuse after i attended a CMS course. I'm building web apps using asp.net and having looked at the version 2 of asp.net , i doubt wehter it is stil necessary to learn cms. The...
0
by: Bob | last post by:
I'm updating a fairly old Perl script. Before I change what seems to be a strange practice, I want to be sure the original author wasn't exploiting some efficiency trick. The hash %foo is used...
2
BSCode266
by: BSCode266 | last post by:
Hey everyone, Right now i am making a program for children which are physically challenged. The purpose of this program is to have children express feelings by playing. So in this game i will need...
2
by: dav3 | last post by:
Hi folks, I am wrapping up a project that has taken me two months to complete. The last obstacle I have to face is finding a way to print something out to the user. I want this to be a pop up...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.