|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
XML Begineers Q's
Ok I've read quite a bit about XML on and off for a year or so, but have shyed away from it until now.
I am currently working on a personal project which I have decided to use XML. Now I have a few questions about XML specifically: 1 - How do I include the & symbol in my documents 2 - How do I link to external sites as I would in a HTML doc? 3 - I have a field in the XML doc named date, I want to sort the date field by date ASC, but how would I specify this in the XSL? My next query really centres about how everything fits together, at the moment I have a HTML doc, CSS, XML, XSL. Obviously the HTML, CSS will provide the presentation, XSL will provide the HTML formatting but how do I display the XML date in the HTML doc - do I need to use a Server Side Language and if so how? Sorry for all the questions. |
|
#2
|
||||
|
||||
|
1. & a m p ; (*without the spaces)
2. you'll have to come up with a node structure and apply an xsl template to it that builds the appropriate html code ("< a href...") 3. take a look at implementing <xsl:sort> it will do what you need. 4. You can pass in the value into the stylesheet as a parameter. Assuming you are using MSXML/ASP: Code:
'ltransform XML and output Set xslTemplate.stylesheet = xslDoc Set xslProc = xslTemplate.createProcessor() xslProc.input = xmlDoc xslProc.addParameter "parameter_field_name", mstrValueOfParamter xslProc.Transform |
|
#3
|
|||
|
|||
|
Thanks for the reply, some of it is a little lost on me as I am still getting to grips with XML so pardon my ignorance.
1 - ok tried that yesterday, and it didn't seem to work. Resolved now? 2 - Huh? 3 - Used <xsl:sort select="date"/> but it didn't sort by ascending date. Any further ideas on this? 4 - Huh? Care to give me a couple of links to some examples of full code? |
|
#4
|
||||
|
||||
|
1. so you got this fixed?
2. i meant "node" to refer to an element structure in your xml that has additional elements inside: Code:
<doc>
<node1>
<para>Text1</para>
</node>
<node2>
<para>Text1</para>
</node>
</doc>
You'll then need an xsl tht does something like: Code:
<xsl:template match="node">
<a href="url">
<xsl:value-of select="."/>
</a>
</xsl:template>
3. Note: <xsl:sort> is always within <xsl:for-each> or <xsl:apply-templates>. View this example: http://www.w3schools.com/xsl/el_sort.asp 4. Again this assumes that you are using MSXML 3.0: http://msdn.microsoft.com/library/d...ddparameter.asp Last edited by mrusaw : July 24th, 2003 at 10:23 AM. |
|
#5
|
|||
|
|||
|
Cheers for that.
I'll have a bit more of a look in to my questions, and get back to you if I need any more assistance. |
|
#6
|
||||
|
||||
|
you got it... i hope that helped.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > XML Begineers Q's |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|