Howdy, Stranger!

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

Categories

How to write a link into XML?

_NeMo__NeMo_ Member Posts: 4
[b][red]This message was edited by Moderator at 2004-4-12 4:17:36[/red][/b][hr]
Hello, I am a newcomer to XML.

Here is my question:

I want to use a tag (like ) which will contain a link to a file.

The problem is when I write a statement, and I connect the xml file with an html table, this link doesn't appear.
All the other fields appear OK.

There is any way to write a link into XML?

Thank you in advance


Comments

  • lillulillu Member Posts: 308
    Hi,

    I am also a newcomer but I can give you a simple solution which I've been using for my purposes:

    link.xml

    <?xml version="1.0" encoding="ISO8859-1"?>
    <?xml-stylesheet type="text/xsl" href="link.xsl"?>

    Link 1
    Link 2
    Link 3


    link.xsl

    <?xml version="1.0" encoding="ISO8859-1"?>



















    As you can see, for simplicity, the xml tag definitions mimic the way of HTML, using for value="" for href="" and the text between Link 1 Link 1

    Three things going in the LINK iteration of the xsl file:

    1. at href="" place the value of VALUE from xml there
    3. go find the text nodes (anything written inside

    Hope this helped,

    Lillu


    : Hello, I am a newcomer to XML.
    :
    : Here is my question:
    :
    : I want to use a tag (like ) which will contain a link to a file.
    :
    : The problem is when I write a statement, and I connect the xml file with an html table, this link doesn't appear.
    : All the other fields appear OK.
    :
    : There is any way to write a link into XML?
    :
    : Thank you in advance
    :

  • _NeMo__NeMo_ Member Posts: 4
    Thank you for your quick reply..

    As a matter of fact your code works fine. But still I have some problems.

    My xml file is

    link.xml
    <?xml version="1.0" encoding="ISO8859-1"?>
    <?xml-stylesheet type="text/xsl" href="link.xsl"?>


    and the xsl file is

    link.xsl
    <?xml version="1.0" encoding="ISO8859-1"?>



















    My collection

    Title Duration Quality Bitrate Link




    With this file I input the data into a table.

    The problem is how I can combine this xsl with yours?
    <?xml version="1.0" encoding="ISO8859-1"?>




















    I have tried some combinations, but it seems that 2 xsls can;t work together...

    My scope is to have a table with the metadata of my videoclips and a link to each of them...

    Thank you SO MUCH for your help till now...


  • lillulillu Member Posts: 308
    Hi,

    Of course it doesn't work. You must tailor my snippet into yours taking carefully the node structure into consideration. My example was just to show how a link can work but when you embed it in yours, you have to adjust it to your elements.

    So, I changed your xml a bit as I didn't find a root node. I assume you want to list more than one video otherwise what's the point? So will hold all
  • infidelinfidel Member Posts: 2,900
    : link1.xml
    [code]
    <?xml version="1.0" encoding="ISO8859-1"?>
    <?xml-stylesheet type="text/xsl" href="link1.xsl"?>



    [/code]

    : And now the XSL:
    [code]
    <?xml version="1.0" encoding="ISO8859-1"?>




    My collection


    Title Duration Quality Bitrate Link






















    [/code]

    No sense in having the VIDEOS/VIDEO collection if you're not going to make templates to take advantage of it. I'm sure it was just an oversight in this trivial example.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

  • lillulillu Member Posts: 308
    Thanks infidel, just realized...

    Lillu

    : : link1.xml
    : [code]
    : <?xml version="1.0" encoding="ISO8859-1"?>
    : <?xml-stylesheet type="text/xsl" href="link1.xsl"?>
    :
    :
    :
    : [/code]
    :
    : : And now the XSL:
    : [code]
    : <?xml version="1.0" encoding="ISO8859-1"?>
    :
    :
    :
    :
    :
    :

    My collection

    :
    :
    : : : : : : :
    :
    TitleDurationQualityBitrateLink
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :
    :

    :
    :
    :
    :
    :
    : [/code]
    :
    : No sense in having the VIDEOS/VIDEO collection if you're not going to make templates to take advantage of it. I'm sure it was just an oversight in this trivial example.
    :
    :
    : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    :
    :

  • _NeMo__NeMo_ Member Posts: 4
    [b][red]This message was edited by Moderator at 2004-4-12 4:29:27[/red][/b][hr]
    Thank you very much for your replies!!

    I also come out with some xsl code:

    link1.xml

    <?xml version="1.0" encoding="ISO8859-1"?>
    <?xml-stylesheet type="text/xsl" href="link1.xsl"?>






    And now the XSL:

    <?xml version="1.0" encoding="ISO8859-1"?>
















    TITLE:



    DURATION:



    QUALITY:



    BITRATE:


    =======================================================>





    Now if I want to filter the data that this xsl depicts, can I use the
    statement?

    I have tried it without encouraging results.

    Thanks again...



  • lillulillu Member Posts: 308
    Hi,

    I corrected link1.xsl as you could not add more than one
  • _NeMo__NeMo_ Member Posts: 4
    Thank you.... you are a lifesaver...


    : Hi,
    :
    : I corrected link1.xsl as you could not add more than one
Sign In or Register to comment.