|
Re: How to skip html tags within a file loaded by EMF [message #524142 is a reply to message #524110] |
Tue, 30 March 2010 22:32 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------010707080309000601040005
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Tamar,
Comments below.
Tamar Cohen wrote:
> Hello EMF world,
>
> So I have tried umpteen solutions I've found online to no avail. My
> problem is that certain areas (within <description>) in files I am
> loading contain html tags. The XMLHandler tries to process the tag as
> a feature. Instead I want the entire block as a string, which would
> contain the html tags.
No, you can't just turn structured XML into a string value.
>
> I am using an ExtendedMetaData in my ResourceFactoryImpl, and I have
> played around with various load options; I have modified this
> attribute to be an element and tried OPTION_ESCAPE_USING_CDATA.
> I have also tried setting the processing kind to mixed.
>
> Has anyone else solved this problem? What am I missing?
If you expressed to the model as an XML Schema, you'd make use of
wildcards, e.g., xsd:any. You can learn about how EMF supports those here:
< http://www.theserverside.com/news/1364302/Binding-XML-to-Jav a>
http://www.theserverside.com/news/1364302/Binding-XML-to-Jav a
>
> Thanks much.
> Tamar
>
> The stack trace is here:
>
> Caused by: org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature
> 'br' not found. (file:/bla/bla/bla.kml, 40, 6)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLH
> andler.java:1776)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML
> Handler.java:1023)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa
> ndler.java:1001)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa
> ndler.java:712)
> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser
> .startElement(AbstractSAXParser.java:533)
> at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume
> ntParser.emptyElement(AbstractXMLDocumentParser.java:220)
> at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScanner
> Impl.scanStartElement(XMLNSDocumentScannerImpl.java:322)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS
> cannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFra
> gmentScannerImpl.java:1693)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS
> cannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java: 368)
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuratio
> n.parse(XML11Configuration.java:834)
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuratio
> n.parse(XML11Configuration.java:764)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(X
> MLParser.java:148)
> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser
> .parse(AbstractSAXParser.java:1242)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.
> java:181)
> at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes
> ourceImpl.java:180)
> at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour
> ceImpl.java:1494)
> at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour
> ceImpl.java:1282)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo
> ad(ResourceSetImpl.java:255)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo
> adHelper(ResourceSetImpl.java:270)
--------------010707080309000601040005
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Tamar,<br>
<br>
Comments below.<br>
<br>
<br>
Tamar Cohen wrote:
<blockquote cite="mid:hoth0e$ime$1@build.eclipse.org" type="cite">Hello
EMF world,
<br>
<br>
So I have tried umpteen solutions I've found online to no avail. My
problem is that certain areas (within <description>) in files I
am loading contain html tags. The XMLHandler tries to process the tag
as a feature. Instead I want the entire block as a string, which would
contain the html tags.
<br>
</blockquote>
No, you can't just turn structured XML into a string value.<br>
<blockquote cite="mid:hoth0e$ime$1@build.eclipse.org" type="cite"><br>
I am using an ExtendedMetaData in my ResourceFactoryImpl, and I have
played around with various load options; I have modified this
attribute to be an element and tried OPTION_ESCAPE_USING_CDATA. <br>
I have also tried setting the processing kind to mixed.
<br>
<br>
Has anyone else solved this problem? What am I missing?
<br>
</blockquote>
If you expressed to the model as an XML Schema, you'd make use of
wildcards, e.g., xsd:any. You can learn about how EMF supports those
here:<a
href=" http://www.theserverside.com/news/1364302/Binding-XML-to-Jav a"><br>
</a>
<blockquote><a
href=" http://www.theserverside.com/news/1364302/Binding-XML-to-Jav a"> http://www.theserverside.com/news/1364302/Binding-XML-to-Jav a</a><br>
</blockquote>
<blockquote cite="mid:hoth0e$ime$1@build.eclipse.org" type="cite"><br>
Thanks much.
<br>
Tamar
<br>
<br>
The stack trace is here:
<br>
<br>
Caused by: org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature
'br' not found. (<a class="moz-txt-link-freetext" href="file:/bla/bla/bla.kml">file:/bla/bla/bla.kml</a>, 40, 6)
<br>
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLH
andler.java:1776)
<br>
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML
Handler.java:1023)
<br>
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa
ndler.java:1001)
<br>
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa
ndler.java:712)
<br>
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser
..startElement(AbstractSAXParser.java:533)
<br>
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume
ntParser.emptyElement(AbstractXMLDocumentParser.java:220)
<br>
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScanner
Impl.scanStartElement(XMLNSDocumentScannerImpl.java:322)
<br>
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS
cannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFra
gmentScannerImpl.java:1693)
<br>
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS
cannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java: 368)
<br>
at com.sun.org.apache.xerces.internal.parsers.XML11Configuratio
n.parse(XML11Configuration.java:834)
<br>
at com.sun.org.apache.xerces.internal.parsers.XML11Configuratio
n.parse(XML11Configuration.java:764)
<br>
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(X
MLParser.java:148)
<br>
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser
..parse(AbstractSAXParser.java:1242)
<br>
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
<br>
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.
java:181)
<br>
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes
ourceImpl.java:180)
<br>
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour
ceImpl.java:1494)
<br>
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour
ceImpl.java:1282)
<br>
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo
ad(ResourceSetImpl.java:255)
<br>
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo
adHelper(ResourceSetImpl.java:270)
<br>
</blockquote>
</body>
</html>
--------------010707080309000601040005--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.02876 seconds