Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: xlink help

  1. #1
    New Coder
    Join Date
    Jul 2008
    Posts
    64
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Question xlink help

    i have this simple xml code and i placed some xlink stuff
    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <Homepages xmlns:xlink="http://www.w3c.org/1999/xlink">
    	<homepage xlink:type="simple"
    	xlink:href="http://www.w3schools.com">Visit w3schools</homepage>
    </Homepages>
    but then when i run it on a browser, it just output the code itself



    because of this, i created an xslt file to accompany the output
    Code:
    //xml with xsl stylesheet
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="xlink.xslt"?>
    <Homepages xmlns:xlink="http://www.w3c.org/1999/xlink">
    	<homepage xlink:type="simple"
    	xlink:href="http://www.w3schools.com">Visit w3schools</homepage>
    </Homepages>
    Code:
    //XLS FILE
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    	<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="/">
    <html>
    	<head>
    		<title></title>
    	</head>
    	<body>
    	<h1>
    		<xsl:value-of select="." />
    	</h1>
    	</body>
    </html>
    </xsl:template>	
    </xsl:stylesheet>
    and here's the new output


    it didn't produce a link ..what should i do now ?

  • #2
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,460
    Thanks
    1
    Thanked 23 Times in 21 Posts
    Well, the initial error was about no style sheets. So give it a CSS style sheet instead of a XSLT one. For instance, are your homepage elements supposed to be display: inline or display: block? What font styling for your link?
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •