Click to See Complete Forum and Search --> : Hide XML from browser


trillion
10-26-2006, 03:12 AM
I need to hide some XML content from being displayed in the site visitor's web browser while retaining usability for providing data to various pages.

Basically I want the file to be read if called from a particular place and read denied if called directly.

I have tried <access-control
but this denied use in the opposite manner where I could access the file directly from a particular url base but could not can it from another page indirectly.

Thank you for any help.

Charles
10-26-2006, 05:21 AM
Just provide an XSLT stylesheet that transforms the XML to some neutral, or blank, HTML. In you XML file's prolog, something like:<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="hide-it.xsl" type="text/xsl"?>And then as hide-it.xsl, somethng like:<?xml version="1.0" encoding="iso-8859-1"?>

<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output
doctype-public="-//W3C//DTD HTML 4.01//EN"
doctype-system="http://www.w3.org/TR/html4/strict.dtd"
encoding="iso-8859-1"
indent="yes"
method="html"
version="4.01"/>

<xsl:template match="/">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<meta name="Content-Script-Type" content="text/javascript"/>
<meta name="Content-Style-Type" content="text/css"/>
<title>Example</title>
<link rel="shortcut icon" href="/favicon.ico"/>

<link href="/style-screen.css" media="screen" rel="stylesheet" type="text/css"/>
<link href="/style-print.css" media="print" rel="stylesheet" type="text/css"/>
</head>
<body>
<h1>Example</h1>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

sandy004.u
02-25-2010, 06:55 AM
hi friends..
can u give me..

<link href="/style-screen.css" media="screen" rel="stylesheet" type="text/css"/>
<link href="/style-print.css" media="print" rel="stylesheet" type="text/css"/>


as you have mentioned, i did every thing but still its not working...