Jump to content

Recommended Posts

Posted

Hello,

 

I have a program that i can automate to produce an xml report each morning.

 

Staff would like the information contained in the page viewable as a webpage.

 

To make any sense of the XML i have followed a guide and created an XSL page. I undertsand that if the XML page contains a reference to the XSL page then the page can be rendered correctly.

 

The formatting will never change so the XSL can stay static.

 

I have done all this and it works great i have a page displaying the XML nicely on a webpage. But how do i get each new, daily generated XML page to know that it has to reference the XSL page? I would like this to be autmated if possible. Is there a way of injecting the reference?

 

Am i going about this the wrong way round?

 

TIA

Posted (edited)
The program is a behaviour recording system. It can generate a file, such as the shortened one i have attached. I can create an xsl file that can produce a table and separate the headings into columns, but i am not sure how to make all newly produced files,- link to the xsl file.

RC2009126.txt

Edited by steele_uk
Posted

I'd obfuscate that file a bit more thoroughly.

 

You either need to have your stylesheet link embedded by whatever generates the XML, or do it yourself later on, either by hand or automated.

Posted

Assuming you're on a linux system, try a cron job running something like

sed -e 's/^<(.*?)>/<\1>/' inputFileName > outputFileName

... or something on the generated file.

That should use sed to parse the file named inputFileName, find a match to the regex, and replace it with something else, then store that processed file in outputFileName.

 

The quoted bit breaks down as:

s - Search and replace

/^<(.*?)> - find me the start of the file (^), then a <, then stuff until a >

/<\1>, then

 

I've not tested this and verified the exact syntax, but I'd expect something in that direction to do the job.

 

... of course if you're on a Windoze server you'll not have the same tools, so I can't help you there. Good luck.

 

Hello

:-Dave

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...