sentence stringlengths 1 1.38k | label stringclasses 3 values |
|---|---|
JAXB Bindings File Sets @XmlElement type to String instead of XMLGregorianCalendar. | o |
I'm trying to create an CODETERM1 that takes in an CODETERM2 and outputs an CODETERM3 . | o |
The purpose is simlply to remove timezone data from the element when unmarshalling data. | o |
It looks like this: CODESNIPPET_JAVA1 . | o |
This works fine for the following code: CODESNIPPET_JAVA2 . | p |
Unfortunately, when I generate the code using a CODETERM4 file, the above code looks like this: CODESNIPPET_JAVA3 . | n |
It sets the type to CODETERM5 , so my above method doesn't work. | o |
The type CODETERM6 setting is overriding the CODETERM7 type that it should be. | o |
I can manually change it, but I'd rather not have to remember to update it every time the jaxb files are regenerated. | o |
Does anyone know if there's an option to manually set the CODETERM8 type or have it ignored? | o |
Here is the relevant portion of the CODETERM9 file: CODESNIPPET_JAVA4 . | o |
It might be that the XPath term in your Binding is not finding the required element. | o |
You don't need the dot since // searches in the entire document. | o |
And more importantly try surrounding the element name with ''. | o |
Resulting term should look like this: node="//xs:element[@name='bar-date']". | o |
What does the XSD look like? | o |
Is the bar-date element defined as xs:string or a complexType? | o |
maybe i'm wrong, but i think marshall/unmarshall pursuit a different goal, what you are trying to do is conceptually incorrect. | n |
maybe the timezone removal itself is incorrect, why would someone do it? | o |
Please provide the xsd, without it its difficult to guess the issue, or recreate it. | n |
the bar-date element should be defined with a xsd:date type. | o |
Is this the case ? | o |
sorry, too long for a comment... i can't understand: 1. why the hell are you using CODETERM1 ? | o |
2. why should you CODETERM2 / CODETERM3 ( CODETERM4 / CODETERM5 ) to the very same data structure? | o |
3. why should you remove timezone?? | o |
and 1. i use straight and simple CODETERM6 2. | p |
CODETERM7 / CODETERM8 should always involve CODETERM9 s (at least for XML) 3. i really don' see a good reason to arbitrarily remove a piece of a date representation. | p |
maybe you want to serialize it in an absolute way. | o |
however CODESNIPPET_JAVA1 . | o |
HTML/XML Parser for Java. | o |
What HTML parsers have the following features:
Fast
Thread-safe
Reliable and bug-free
Parses HTML and XML
Handles erroneous HTML
Has a DOM implementation
Supports HTML4, JavaScript, and CSS tags
Relatively simple, object-oriented API What parser you think is better? | o |
Thank you. | p |
what do you mean by "support HTML4, javascript and CSS" ? | o |
A parser is just that, a parser, it won't interpret your page. | o |
If you want to simulate a browser, please rephrase your question. | o |
No. | o |
Some parsers do not understand things like CSS. | o |
This is what I mean. | o |
If CSS is in a <style> tag, it will be interpreted as text. | o |
Check out URL_http://web-harvest.sourceforge.net/ [Web-Harvest] . | o |
It's both a library you can use and a data extraction tool, which sounds to me that's exactly what you want to do. | o |
You create XML script files to instruct the scraper how to extract the information you need and from where. | o |
The provided GUI is very useful to quickly test the scripts. | p |
Check out the URL_http://web-harvest.sourceforge.net/samples.php [project's -samples-page] to see if it's a good fit for what you are trying to do. | p |
+1 for Web Harvest -- if you are trying to do page scraping it is the way to go. | o |
The best known are URL_http://nekohtml.sourceforge.net/ [NekoHTML] and URL_http://jtidy.sourceforge.net/ [JTidy] . | p |
NekoHTML is based on Xerces, and provides a simple adaptable URL_http://nekoht ml.sourceforge.net/javadoc/org/cyberneko/html/parsers/SAXParser.html [SAXParser] which implements URL_http://java.sun.com/javase/6/docs/api/org/xml/sax/XMLReader.html [XMLReader] JavaSE interface. | p |
JTidy is more intented into formatting your html code into something XML- valid, but is still very useful as an XML parser, producing a DOM tree if needed. | o |
You could have a look at URL_http://java-source.net/open-source/html-parsers [this-list] for other alternatives. | o |
Another choice could be to use URL_http://github.com/whymirror/hpricot [hpricot] through jRuby. | o |
Why? | o |
which features do they have? | o |
added some details. | o |
SAX is not what I want and main purpose of JTidy is cleaning an XML. | p |
Are you sure that it does what i want better than others? | o |
what do you want exactly, then ? | o |
It should be DOM based. | o |
and I want extraction as it's main job not transformation. | o |
It doesn't matter what its "main" job is, as long as it does what you want it to do. | o |
URL_http://about.validator.nu/htmlparser/ [Validator.nu's-HTML-parser] , definitely. | o |
It's an implementation of the HTML5 parsing algorithm, and Gecko is in the process of replacing its own HTML parser with a C++ translation of this one. | o |
URL_http://tika.apache.org/ [Apache-Tika] is the best choice. | p |
Apache has recently extracted many sub-projects out of the existing projects and made them public. | o |
Tika is one of them that was previously a component of Apache Lucene. | o |
Because of Apache's support and reputation and the widely-used parent project Lucene it must be a very good choice. | p |
Furthermore, it is open-source. | o |
A brief introduction from Apache Tika web site:
The Apache Tika toolkit detects and extracts metadata and structured text content from various documents using existing parser libraries. | o |
And the supported formats are:
CODESNIPPET_JAVA1 . | o |
Apache Tika is an excellent suggestion. | p |
Even if you are not interested in reading XML/HTML/MS DOC formats you can just specify "text/plain". | o |
It will stream in the data so it doesn't need to preload the whole file first. | o |
List of benefits: URL_http://tika.apache.org/1.4/parser.html Article with sample code: URL_http://www.openlogic.com/wazi/bid/314389/Content-mining-with-Apache-Tika . | p |
I came for a solid HTML Parser, and left with one that I won't have to spend the time to generalize. | o |
I love this game. | p |
you probably want to look at doing something like running Mozilla in headless mode. | o |
Here is a URL_http://www.holovaty.com/writing/headless-html-rendering- engine/ [link] to get you started, I am sure you can use Google to find out more information. | o |
Well: there aren't so many good HTML parsers in java as you need, but here are some alternatives: URL_http://java-source.net/open-source/html-parsers [http ://java-source.net/open-source/html-parsers] Very few of them support Javascript. | p |
Actually, I think you'll have to do this part on your own using Rhino ( URL_http://www.mozilla.org/rhino/) . | o |
I think that URL_http://htmlcleaner.sourceforge.net/ [HTML-Cleaner] is what you're looking for. | o |
See its URL_http://www.theserverside.com/news/thread.tss?thread_id=50059 [announcement] on TheServerSide to see how it compare to JTidy, TagSoup, NekoHtml. | o |
But this is also for transforming into well XMLs. | p |
My main goal is extracting data from it. | o |
@Shayan So what? | o |
Doesn't it allow you to extract data from it? | o |
Doesn't it offer DOM manipulation? | o |
Doesn't it allow to parse nasty HTML? | o |
I don't get you. | o |
Which is the best library for XML parsing in java. | o |
I'm searching the java library for parsing XML (complex configuration and data files), I googled a bit but couldn't found other than dom4j (Seems like they are working on V2).. | n |
I have taken look at commons configuration but didn't liked it, Other apache projects on XML seems under hibernation. | o |
I haven't evaluated dom4j by myself but just wanted to know - Do java has other (Good) open source xml parsing library? | o |
and how's your experience with dom4j? | o |
After the @Voo's answer let me ask another one - Should I use java's in built classes or any third library like dom4j.. What are the advantages? | o |
Can you define good? | o |
Performance, quality of API, something else? | o |
Performance and ease of use (yes, Quality of API). | o |
You've not posted any specific reasons for not using Java's native implementations. | o |
vtd-xml will be the one to beat for performance/memory usage and ease of use. | n |
Actually Java supports 4 methods to parse XML out of the box: DOM Parser/Builder: The whole XML structure is loaded into memory and you can use the well known DOM methods to work with it. | n |
DOM also allows you to write to the document with Xslt transformations.Example: CODESNIPPET_JAVA1 . | o |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.