xerces

How to parse (non well-formed) HTML in android?

穿精又带淫゛_ 提交于 2019-12-11 13:48:42
问题 How to parse non well-formed HTML in android ? I tried to use XOM and TagSoup, but i get the following error when creating the Builder: 11-26 20:42:39.294: ERROR/dalvikvm(1298): Could not find method org.apache.xerces.impl.Version.getVersion, referenced from method nu.xom.Builder. Must i install Xerces to use XOM or can i use tagsoup without XOM ? 回答1: You might find JTidy (http://jtidy.sourceforge.net/) - a port of HTMLTidy to be sufficiently lightweight. It outputs XHTML on request 回答2: XOM

Xerces behaving differently on SUN JRE v1.5 and IBM J9 v1.5

≯℡__Kan透↙ 提交于 2019-12-11 12:48:22
问题 I am trying to parse some HTML using NekoHTML. The problem is that when the below code snippet is executed on the SUN JDK 1.5.0_01 it works fine (this is when i am using eclipse with sun jre). But when the same thing is executed on IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Windows XP x86-32 j9vmwi3223ifx-20070323 (JIT enabled) then it is not working (this is when i am using the IBM RAD for development). NodeList tags = doc.getElementsByTagName("td"); for (int i = 0; i < tags.getLength(); i+

How to do this in XSLT without incrementing variables? (Tweaking Xalan to create a global XSLT iterator. Do I have other options?)

China☆狼群 提交于 2019-12-11 10:30:58
问题 I'm trying to think functional, in XSLT terms, as much as possible, but in this case, I really don't see how to do it without tweaking. I have roughly this data structure: <transactions> <trx> <text>abc</text> <text>def</text> <detail> <text>xxx</text> <text>yyy</text> <text>zzz</text> </detail> </trx> </transactions> Which I roughly want to flatten into this form <row>abc</row> <row>def</row> <row>xxx</row> <row>yyy</row> <row>zzz</row> But the tricky thing is: I want to create chunks of 40

codesynthesis not parsing my xml file

為{幸葍}努か 提交于 2019-12-11 09:58:41
问题 I am using codesynthesis to generate classes which represent my xsd file. The xml file has been validated against the schema file using an online validation program and it seems to be fine. However upon running my program which simply reads the xml and attempts to create the structures representing the xml file i get exceptions for every element such as : error: attribute 'dburl' is not declared for element 'quantoptions', error: no declaration found for element 'option' and error: no

Validate XML against schema on Android using Xerces

对着背影说爱祢 提交于 2019-12-11 09:48:23
问题 So, after consulting with this thread that the javax.xml.validation library does not work on Android I had to find another solution. I have tried using the Xerces API and although it seems that it is working fine for a lot of people, I can't get it to work properly. I am using a local XML schema stored in a file in the sdcard. The code I am using is as follows: public static boolean validate(String XmlDocumentUrl, String SchemaUrl) { SAXParser parser = new SAXParser(); try { parser.setFeature

Xerces-C XML schema validation not working

笑着哭i 提交于 2019-12-11 07:44:35
问题 Trying to get Xerces-C to validate an XML file against a schema file but with no luck. The constructor below takes in the location of the XML file and the schema file and sets relevent member variables: Config::Config(const std::string& schemaFile, const std::string& XMLFile) : m_schemaFile(schemaFile), m_XMLFile(XMLFile) { { //initialize try { xercesc::XMLPlatformUtils::Initialize(); xalanc::XPathEvaluator::initialize(); } catch (xercesc::XMLException& e) { throw

shared library compiles, but has undefined symbols

谁说我不能喝 提交于 2019-12-11 07:35:36
问题 I am getting something like the following: Exception in thread "main" java.lang.UnsatisfiedLinkError: no viewerNativeDLL in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1028) at viewer.SarBufferedImage.<clinit>(SarBufferedImage.java:356) at viewer.viewerJPanel.<init>(viewerJPanel.java:34) at viewer.ViewerView.initComponents(ViewerView.java:457) at viewer.ViewerView.

Example to validate a xml-File against an XSD v1.1 Schema in Java 1.8

一曲冷凌霜 提交于 2019-12-11 04:44:12
问题 My current validation does not work for XSD v1.1 Schemas .. I tried many things to change that, but until now without success It does not matter for me if the solution is done with Saxon or Xerces (Edit: I dont want to spend money to solve the problem and it looks like Saxon XSD1.1 validation is not for free, so I quess I have to stick with Xerces) Yes, I already searched SO for that, but so far none of the code-snippets helped me to get a working validation. The code is goin to be used in an

Get schema data types from Xerces

本小妞迷上赌 提交于 2019-12-11 03:19:53
问题 I am using SAX2 in Xerces C++ and would like to get XML Schema data while I handle elements so that I know their type defined in the Schema. How can I accomplish this? 回答1: Okay, I figured out how to do this. Sparse documentation available on the subject. Apparently I need to cast the SAX2XMLReader that XMLReaderFactory::createXMLReader() returns, to a SAX2XMLReaderImpl. Then I can register an PSVIHandler implementation on that interface. I have to provide my own implementation of the

preventing empty xml elements are converted to self closing elements

白昼怎懂夜的黑 提交于 2019-12-10 20:38:18
问题 I am using Xerces Library for writing XML in document . For that I am using OutputFormat class passing the object of OutputFormat in XMLSerializer. But all of my empty xml elements are converted to self-closing xml elements. I want this: <Company Name="Dummy"> </Company> But its coming like <Company Name="Dummy" /> I have tried below code: try { //print OutputFormat format = new OutputFormat(dom,"iso-8859-1",true); //to generate output to console use this serializer XMLSerializer serializer =