Click to See Complete Forum and Search --> : XML XSL transformation required on closed network


mperemsky
05-04-2009, 11:17 AM
Hello all, I am fairly new to xml/xsl and have a question. I am working on a project that has very tight security. It operates on a closed network and does not allow access to any external machines. I am trying to find out what DTDs are required to execute the xml/xsl transformations within our network (and how to acces them).

An example xml file looks like the following:


<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="entity.xsl"?>

<document id="86448" title="CPP20071207968235_001124_a.txt" collection="OpenAirColl" date="28-Apr-2009 13:48">
<entities>
<entity name="ADDRESS_INTERNET">
<entry relpctg="15">OSCinfo@rccb.osis.gov</entry>
<entry relpctg="39">https://www.opensource.gov</entry>
</entity>
...
</entities>
</document>


An example xsl file looks like


<?xml version="1.0" encoding="ISO-8859-1"?>

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

<xsl:template match="/">
<html>
<head>
<link href="metareport.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="hdr1 center">Keywords By Entity Type By Document Report</div>
<div class="padtmed"></div>
...
</body>
</html>
</xsl:template>

</xsl:stylesheet>


If I change the <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> line, the data does not get transofrmed into the HTML file I expect (no data shows up). How can I find/get the DTD to allow the transformation to occur (e.g. xsl:for-each, xsl:value-of)? How do I specify the dtd locally in the xsl file?

jkmyoung
05-06-2009, 04:09 PM
?? How are you changing the line?

DTD Declaration Do you want the DTD declaration to appear in the source input, or the final output?
Source: Declare like so - http://www.javacommerce.com/displaypage.jsp?name=saxparser5.sql&id=18232
Final output: Like so - http://www.w3schools.com/xsl/el_output.asp.

Is your entity.xsl in the same directory as your source xml?

How are you processing this; just opening it up in a web browser? If so, which one?

mperemsky
05-07-2009, 08:44 AM
?? How are you changing the line?

That is what I am trying to figure out. When the namespace xmlns:xsl="http://www.w3.org/1999/XSL/Transform" is specified, what exactly is it pulling from that location? What I need to do is modify the URI so that it points to a location within the network, I was thinking of something like

http://localhost/MyApp/xslt/

However, I do not know what I need to have located at that location. I assume there is a DTD that is supposed to be there so that it knows how to perform the transformations. I cut/pasted the DTD from http://www.w3.org/TR/xslt#dtd and created a DTD from it. I am assuming that I, somehow, need to load this DTD so that the xml/xsl transformation can take place.


DTD Declaration Do you want the DTD declaration to appear in the source input, or the final output?
[/QUOTE/

I assumed the DTD was being used for the transformation. I am new to this.

[QUOTE]
Is your entity.xsl in the same directory as your source xml?

Yes


How are you processing this; just opening it up in a web browser? If so, which one?

I am using the xalan.jar and performing the transformation on the server side. There is a 3rd party piece that also implements transformations, but I am not sure how they are doing it.


Everything I am doing here is based on assumptions. My goal is to take whatever files I need and store them within the closed network so that it does not try to access anything outside of it (which it obviously would never get to).

I don't even know what the stylesheet (or transformer) is looking for at xmlns:xsl="http://www.w3.org/1999/XSL/Transform" or how to get it to load a DTD that is defined locally.

jkmyoung
05-07-2009, 11:47 AM
Ignore this: xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
The definitions of xsl are built into the xsl processor, so it doesn't look up this address at all.

Are you redirecting the output to the appropriate file? What output are you getting?

mperemsky
05-08-2009, 08:33 AM
The data is being transformed into an HTML file. If I remove the "xmlns:xsl="http://www.w3.org/1999/XSL/Transform" line, my HTMl tables are empty (no TR TD elements). If I keep that line in there it properly fills out the table with the data from the xml file.