I am trying to convert an HTML file into XML file using XSLT (Using Oxygen 9.0 for transformation).
The entity 'nbsp' was referenced,but not declared .My input html file is:
Note: I want to know how handle that entity only using the XSLT, I don't want to make any changes to the input file. |
||||
You could use XML Entities to create an XML file that defines the
nbsp entity, and includes the (broken) XML fragment.For example, assume that your fragment is saved as a file called: "invalid.xml"
Create an XML file like this:
When it that file gets parsed, it will have defined the nbsp entity, include the content from the "invalid.xml", and resolve the nbsp entity properly. The result is this:
Then, just adjust your XSLT to accomodate the new document element (in this example the element <wrapper> ). |
||||
As far as I know, you're going to need to make changes to the input file.
Either by changing your to   or by declaring a custom doctype that will do the conversion for you:
This is because isn't one of XMLs predefined entities.
|