[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
2xml files -> one xml file and search question
Subject: 2xml files -> one xml file and search question From: Michael Hoffmann <m-hoffmann@xxxxxx> Date: Wed, 25 Oct 2000 13:48:15 +0200 |
ok i am sorry for not beeing precise enough... to copy the 2 xml files and to show them isnt the problem.. my problem is to write a 3rd file ... i mean are there any commands which write datas into a file ? or do i have to use fp(write) for this ? ---------------------------------------------------------- ohh and another question... i am trying to search a xml file for datas example : XML file : <adress> <name>name one</name> <street>street one</street> </adress> <adress> <name>name two</name> <street>street two</street> </adress> <adress> <name>name three</name> <street>street three</street> </adress> <adress> <name>name four</name> <street>street four</street> </adress> .... XSL file : ... <xsl:for-each select="adress[child::*=$search_text]"> <xsl:value-of select="./adress"/> <xsl:value-of select="./street"/> .... the varable search text is declared and i have no problems to search either for name or for street but how can i search for name + street ? (i have an inputfield and the search_text i get via the browser with <form action="sort.xml" method="get> and then <input type="submit" />. when i enter name and street it looks like http://.../my.xml?search_text=name+one+%2B+street+one (thats what i want so this is not the problem <g>) and the variable search_text has the value "name+one+%2B+street+one" but how can i make 2 strings of it search_text1 (which contains name+one) and search_text2 (which contains street+one) ? somehow i should be able to search for %2B (which is +) and then extract both strings and write them into different variables... anyone did sth like that before ? how can i do that ? and the other problem is if my input isnt exactly the same thing as in the xml file i dont get a result (for example if my input would be just "name" or "Name" or "nam" then i dont get any results.. how can i get all entrys which contains "name" or "nam" then ? is sth like name* or nam* as input possible ?? how can i tell this to my <xsl:for-each select=""> or to <xsl:if test=""> ??) can xsl(t) do this for me ? thx again michael Kay Michael wrote: > > > my problem is, that i have 2 xml files with the same > > structure but with > > different datas inside > > i can display both files but i cant save them as a different file... > > can someone plz help me and show me how to combine those both > > xml files and get a 3rd one with both datas inside ? > > > > <output> > <xsl:copy-of select="document('document1.xml')/*/*"/> > <xsl:copy-of select="document('document2.xml')/*/*"/> > </output> > > Mike Kay > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: 2xml files -> one xml file, Kay Michael | Thread | Re: 2xml files -> one xml file and , Jeni Tennison |
Using XSLT to search XML, e thurairajah | Date | MathML tags in an attribute of an H, Frédéric SCHWEBEL |
Month |