skip same line with Saxon

Here should go questions about transforming XML with XSLT and FOP.
m4tr1x
Posts: 2

skip same line with Saxon

Thu Jul 21, 2005 3:50 pm

I need to skip the first line of my XML because when saxon reed that line don't work well. the line that i need to skip is:

<!DOCTYPE WebML SYSTEM "MyDtd.dtd">

I'd like to know if there is same command that i can use from the command line to say saxon that when there is that line, will be jumped to the next one

Thanks

Marco
george
Site Admin
Posts: 2100

Thu Jul 21, 2005 5:29 pm

Hi,

There is no such command, any conformat XML processor that will read the XML file will try to look into that DTD. Possible solutions depend on what your problem is exactly. If you have the DTD but it is a different location then the solution is to set an entity resolver. If you really want that removed then you have to preprocess the file and remove that before feading it into the transformation.

Best Regards,
George
m4tr1x
Posts: 2

Fri Jul 22, 2005 4:21 pm

Hi,
how can i remove that line before the trasformation? I can' do it manually, i need to do it with same command...

thanks

Marco
Radu
Posts: 5816

Fri Jul 22, 2005 4:43 pm

Hi,

You could make an empty file called "MyDtd.dtd" and place it in the same directory with your xml file. The processor only checks if the dtd file is valid and does not try to validate the xml file in accordance to the dtd file so the transformation will succeed.

If this is not acceptable you can apply a regular expression search on the XML document with the expression "<!DOCTYPE(.*?)SYSTEM\s"(.*?)">" and replace it with the empty string or just make an application that deletes the first line from a file if you are sure the doctype will always be on the first line.

Hope this helps.
Regards, Radu.

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 2 guests