由买买提看人间百态

topics

全部话题 - 话题: saxs
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
O**n
发帖数: 133
1
来自主题: Java版 - Java XML parser的问题
google了一下,发现java有DOM, 还有一种叫SAX的。据说DOM不好。
哪位大虾介绍一下吧,他们有什么区别呢?
如果我想用来parse一个巨大的xml的file, ~500MByte,
应该用哪一个?怎么用呢?
//bow
多谢!
e***g
发帖数: 158
2
来自主题: Java版 - Java XML parser的问题
depends on what you want to do after parse. don't use SAX unless you
have to, it's more work.
g*s
发帖数: 2277
3
来自主题: Java版 - Java XML parser的问题
or use JAXB to get flexibility of DOM and performance of SAX.
e***g
发帖数: 158
4
来自主题: Java版 - How to delete an entry in JAR?
i'll take your word for it, and try to justify that it's not so stupid.
however if it turns out that jar API does do it, then it's your fault:)
if you want to remove one node from an XML file, and you want to use the
'ellegantly designed user friendly' DOM/SAX API, you have to read the whole
thing, change the structure in memory/on the fly, and serialize it to a
new file.
so same thing here for jar. the API is designed to be source/target
agnostic, it does not (want to) concern itself with featu
c*****s
发帖数: 214
5
来自主题: Java版 - java & XML 2 example problem
xerces-api只是API,没有完全实现,还需要有个xercesImpl
http://www.ibiblio.org/maven/xerces/jars/ 有你需要的Jar

org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:121
l***r
发帖数: 459
6
来自主题: Java版 - [转载] a question on XML parser
【 以下文字转载自 Programming 讨论区,原文如下 】
发信人: laoer (You know what!), 信区: Programming
标 题: a question on XML parser
发信站: Unknown Space - 未名空间 (Tue Jun 15 22:29:14 2004) WWW-POST
Greetings,
I have several "<.." in one file. Right now, I first divide this
file to many string. Each string is one xml record. Then, I use Java SAX
parser to parse it. It turns out that it performs very slowly on dividing and
parsing. Is there any better way? like parsing all records in this file in one
time?
Tha
l***r
发帖数: 459
7
来自主题: Java版 - [转载] a question on XML parser

Really? what's my mistake?

It should be no problem because this is created by commercial program. And, my
SAX parser works for this format.
like
should
XML
parser
c*****t
发帖数: 1879
8
I have a question regarding Jelly and other XUL or XAML tools on
error handling. Basically, how they do it.
1. how they handle parse errors. The errors are not syntactic ones
that XML parsers SAX/JDOM detect, but semantic ones like unknown
tags, invalid variables, invalid values, wrong attributes etc.
2. logging.
3. warning/debugging.
I am currently trying to come up a solution to improve CookXml
( cookxml.sourceforge.net )'s error handling, but it would be nice
to know how others doing
c**t
发帖数: 2744
9
来自主题: Java版 - [ZT] choose your java xml parser
http://www.devx.com/xml/Article/16921/0/page/1
The XML parser world is a dynamic one. As standards change, the parsers
change as well--XML parsers are becoming more sophisticated. For most
programming projects, the parser, at minimum, must support DOM Level 2, SAX
2, XSLT, and Namespaces. All the parsers discussed here provide these
capabilities; however, there are distinct differences in performance,
reliability, and conformance to standards. In this article, I'll compare the
latest parsers fro
p***p
发帖数: 559
10
太多了,搞不清楚哪个是干什么的,JDK自身还有,还和其他包互相冲突
DOM,JDOM,Crimson,Xerces,JAXB,SAX....etc
c*****t
发帖数: 1879
11
来自主题: Java版 - StAX, do you use it?
No, what I mean is that when I read the tutorial, it has pieces like:
public final static String getEventTypeString(int eventType)
{
switch (eventType)
{
case XMLEvent.START_ELEMENT:
return "START_ELEMENT";
case XMLEvent.END_ELEMENT:
..
}
}
This is building a state machine (manually build rather than generated
in this case).
Just like using SAX, doesn't matter that it is event driven, you are
still building a state machine by hand.
z****e
发帖数: 54598
12
来自主题: Java版 - Java处理XML
DOM & SAX
随便你了,java这个世界中你永远都不要问别人哪个用得比较多
因为工具太多,你要选择适合你自己的
m******t
发帖数: 2416
13
来自主题: Java版 - 简单算法问题

I
So put your counter in a sax parser, which is lightweight enough.
I still don't see any point in reinventing the whole wheel.
g*****g
发帖数: 34805
14
不一定要SOAP呀,这两年比较火的REST,也有了JAX-RS的标准。
几个实现都不需要你碰XML,JAXB本来就是干这个的,你需要的
就是在DTO里面用annotation做某些定制就好了。
我不是说XML没有用,而是说整个趋势就是你用一个bean去map,
不需要直接接触XML。除非效率要求特高需要SAX,否则我看不出
有啥必要。parse XML就是重建轮子。

XML.
z*******3
发帖数: 13709
15
来自主题: Java版 - abstract class 的简单例子
很多人脑子就是转不过弯来
想想后来为什么会有jsp这种东西
先有servlet再有jsp的
但是你用servlet去写response?
累死你
有了jsp就简单多了
实际上xsl就是起到一个jsp的作用
只不过最终这个东东生产的是xml而jsp最终生产的是html而已
无非就是模板化最终的输出
我相信说到这里还是有人不太理解
肯定会有人还会继续举出各种animal的例子
然后不停地强调,这个方法可行,可行啊可行,我就是这么做的……
另外,pdf之类的,我们也是先做好一个没有填充的pdf模板
然后再通过itext读入以后做数据填充以后再输出
本质上跟jsp还有xsl是一样的
最后就是,xml的解析是core java的东西
dom和sax都是java的标准库,所以这不是什么高级或者是你找不到的东西
就是android里面都有
r******r
发帖数: 700
16
来自主题: Java版 - 我自己编了个Java面试题
介不是面试题,就是寻求点帮助,好的解法吧?
如果不熟悉 RE, 或担心文件过大,就用 XML SAX parser 逐个元素读取文件,遇到每
个 node 中的 qName, 用 replace() 替换,重新输出的文件就是你需要的了。文件再
大也没事。
如果用 Regular Expression, 还要考虑是否 body text 中是否出现的 "<" 或 "/>"
字符的情况。
z****e
发帖数: 54598
17
来自主题: Java版 - 我自己编了个Java面试题
Regular Expression这题写起来非常麻烦
而且Regular Expression并不比xslt简单多少
还不如直接上xslt,不仅规范,而且可以复用代码
但是xslt也要求一定的基础,大多数人未必觉得适应
比较好的方法是上freemarker+xml parsing lib
读和写分成两块,用dom/sax读入
parse完之后,用freemarker写好的template输出
r******r
发帖数: 700
18
来自主题: Java版 - 我自己编了个Java面试题
除非文件特复杂,有特殊要求,否则直接用 java 自己的 SAX parser 就足够了吧。
z****e
发帖数: 54598
19
我给你来个列表,看你能懂多少概念
基本上都是轮子
java
jvm
awt
swt
applet
webstart
swing
javafx
rmi
ejb
sessionbean
entitybean
messagebean
jms
spring
struts
webflow
hibernate
ibatis
ant
gradle
maven
ivy
jboss
eclipse
android
jar
gc
g1
permgen
j2ee
serlvet
jsp
jca
web service
jax-rs
xml
json
annotation
singleton
design patterns
nio
security
dom
sax
hadoop
yarn
vert.x
rxjava
jdbc
jsf
validation
persistence
orm
transaction
javax.util.concurrent
websocket
jruby
jython
rhino
groovy
scala
clojure
polyglot
cassandra
hbase
weka... 阅读全帖
k***r
发帖数: 4260
20
来自主题: Programming版 - 这里有没有玩Delphi的呀?
正在找一个SAX XML parser
x****d
发帖数: 1766
21
来自主题: Programming版 - web service
I would recommend restlet for beginning in Java, you don't need a server to
deploy, you write up your own server, very simple. client side you can use
java or jquery, or rest shell.
but implementing one restful webservice is too simple, it is kind of
irrelevant with understanding web services, either restful or soap. as
bigcow said above.
doing restful services is very different with design rest api, you can do it
, doesn't mean you can design it.
I am kind of agree with zhaoce, doing web servic... 阅读全帖
z****e
发帖数: 54598
22
来自主题: Programming版 - 如何快速处理大量网上xml文件?
随便抓一个好不好?
working的,这扩充成thread很难吗?
extends thread
thread declar
thread.start
加三行
难啥?
http://www.javacodegeeks.com/2013/05/parsing-xml-using-dom-sax-
b*******g
发帖数: 513
23
看了别人如何创建bib file.我也是那样做的,就打开一个text文档,如 txt结尾的那
种文件,编辑一个bib文件 叫bibfile.bib,例如:
@ARTICLE{sax1923association,
author = {Sax, K.},
title = {The association of size differences with seed-coat pattern and
pigmentation
in Phaseolus vulgaris},
journal = {Genetics},
year = {1923},
volume = {8},
pages = {552},
}
然后,在原tex文件中加入 ~\cite{sax1923association},
我的原tex文件中有command
\bibliographystyle{plain}
\bibliography{bibfile}
编译后pdf文件中有 bibliography 那几个黑体字,但没显示那个引用。原文章引用的
地方也没显示引用的文章,倒是括号里有一个问号。请... 阅读全帖
b*******g
发帖数: 513
24
source?指的是原bib文件的代码吗?我的bib原文档放在三个bib文件里(难道这是前两
个citation空缺的原因?),如下:
bibfile1:
@ARTICLE{sax1923association,
author = {Sax, K.},
title = {The association of size differences with seed-coat pattern and
pigmentation
in Phaseolus vulgaris},
journal = {Genetics},
year = {1923},
volume = {8},
pages = {552},
}
@article{amos1990multivariate,
title={A multivariate method for detecting genetic linkage, with
application to a pedigree with an adverse lipoprotein phenotype.},
author={Amos,... 阅读全帖
g***l
发帖数: 21
25
来自主题: XML版 - SAX and DOM parsers
What is the defintion of the types of parsers?
I found some parsers, but I don't exactly how to program
them? Can someone give me a some hints? It is esp. good if
some tutorials for the parser programming.
thanks
a**e
发帖数: 25
b****e
发帖数: 1275
27
来自主题: XML版 - SAX and DOM parsers
that site looks horrible.. can't figure out what is
a good read (the whole site looks very very amateur
IMHO) :)
i'm interested in processing xml files in a java
program too.. where do i start?
just downloaded xml4j from ibm site.. not sure how
to use it yet
j*******r
发帖数: 201
28
来自主题: XML版 - SAX and DOM parsers
i think you can find a lot of smaples on how to use java
to parse xml by DOM in IBM websites.
if you need, i can email a good book xml&java by ibm.
good luck,
b****e
发帖数: 1275
29
来自主题: XML版 - SAX and DOM parsers
ah.. how big is the email? that'd be great! thanks
j*******r
发帖数: 201
30
来自主题: XML版 - SAX and DOM parsers
javaxml.pdf, 532k.
s******n
发帖数: 22
31
来自主题: XML版 - xml parser?

to parse an .xml into a DOM, try
DOMParser in org.apapche.xerces.parsers
to serialize the DOM back to .xml, try
XMLSerialize in org.apache.xml.serialize
sure there are also tools dealing with SAX or so.
http://xml.apache.org/xerces-j/index.html
b***k
发帖数: 77
32
来自主题: XML版 - xml parser
Oracle also has one, and apache and James Clark's ...
Which one to choose depends on what kind of interface you want, SAX or DOM
and what other information you want from XML and whether you want well-formed
or validated.
z****g
发帖数: 2497
33
来自主题: XML版 - xml parser
for small document, jdom is ok.
For huge ones, sax wins.
r****a
发帖数: 2
34
来自主题: XML版 - Any APIs for handling XML?
DOM or SAX, as i know
g****y
发帖数: 141
35
来自主题: XML版 - one simple question
SAX is read only
P*****x
发帖数: 72
36
来自主题: XML版 - XML parser ???
DOM parser is easy to use, sax parser is faster w/ smaller memory footprint.
m**c
发帖数: 90
37
来自主题: XML版 - [转载] help! XML parse problem

You can create a InputSource object which contains input string (wrapped
inside StringReader object):
...
StringReader sr = new StringReader(inputStr);
InputSource is = new InputSource(sr);
saxParser.parse(is, xxx); // SAX parser
domParser.parse(is, xxx); // DOM parser
...
l***y
发帖数: 25
38
来自主题: XML版 - Help: Several questions on XML
1. Is there any kind of "polymorphism" in XML like
in Java? Can type substitution do this?
2. Having defined an XML schema(*.xsd), How can I
validate my XML instance file using any XML parser?
I am using SAX parser.
3. And given a *.xsd file, if I want to define any
instance file, I can use the global element and
global attribute. Can I directly use the global types
(either simple or complex) defined in the schema?
Maybe the questions are trivial or not well stated, but
your help will be highly
c*****t
发帖数: 1879
39
来自主题: XML版 - [转载] XML question
【 以下文字转载自 Java 讨论区 】
【 原文由 coconut 所发表 】
All of the following refer to parsing XML, not writing XML document
itself.
I went through Sun's XML tutorial using SAX and have some
questions.
1. Does one really write those handlers by hand? It is just insane.
How in the world does one differentiate different elements since they
are just poured in to the same handler. if tree can work, but then
the performance can suck bad. DOM is slightly simpler, but still
traversing the tree is not simple (since
c***r
发帖数: 4631
40

i faint.
qm
发帖数: 27
41
来自主题: XML版 - SAX 怎么念?
S-AR-X or SEX?
s**g
发帖数: 15
42
来自主题: XML版 - SAX 怎么念?
like saxphone
f*****g
发帖数: 31
43
来自主题: XML版 - SAX 怎么念?

SUCKS
l***r
发帖数: 459
44
来自主题: XML版 - [转载] a question on XML parser
【 以下文字转载自 Programming 讨论区,原文如下 】
发信人: laoer (You know what!), 信区: Programming
标 题: a question on XML parser
发信站: Unknown Space - 未名空间 (Tue Jun 15 22:29:14 2004) WWW-POST
Greetings,
I have several "<.." in one file. Right now, I first divide this
file to many string. Each string is one xml record. Then, I use Java SAX
parser to parse it. It turns out that it performs very slowly on dividing and
parsing. Is there any better way? like parsing all records in this file in one
time?
Tha
s***e
发帖数: 284
45
来自主题: XML版 - [转载] a question on XML parser
SAX is good for directly reading from the XML file. Why do you divide
the file into many strings at first?
a*****a
发帖数: 1429
46
来自主题: XML版 - [转载] PERL XML parser
【 以下文字转载自 Linux 讨论区,原文如下 】
发信人: atnalta (职业debugger), 信区: Linux
标 题: PERL XML parser
发信站: Unknown Space - 未名空间 (Tue Jul 6 14:58:18 2004) WWW-POST
I'm developing a scripting tool on PERL. Need to use XML parser.
I am familiar with PERL and XML, but never have experience on PERL
and XML combination. I've searched CPAN, got 70+ modules. Don't know
which is the most popular. Just need SAX parser. Any suggestions?
J*******e
发帖数: 63
47
来自主题: XML版 - Where to download SAX-C++ library?
thx
s***m
发帖数: 6197
48
来自主题: Biology版 - 文章求助!
麻烦能下这篇saxs的文章的xdjm给发一下吧
http://www.cell.com/structure/abstract/S0969-2126(10)00185-1
谢谢啦!
请发到我的站内信箱
或者邮箱
b*****************[email protected]
或者提供下载链接
谢谢!
f**********e
发帖数: 1994
49
structure prediction 隔一阵子就会有一些边角料出来,SAXS,
cryo-EM, Bayesian... 但这改变不了他们是边角料的事实。几个
创始者拿到一两个位置,然后所有的 followers 就等着做万老。
拜托,请相信我,我和 structure prediction/molecular
dynamics 的大头工作过。这真的是巨型屎坑,学术界工业界都没人要。
n********k
发帖数: 2818
50
This is a smart, very focused and productive one I have heard from people
working with him...XD Wang's first student was even more impressive if I am not too old:) and several from HJ Song's lab also have impressive records, A and P from this board both have impressive records in pretty shoret time too...
BTW, to upbeat/Q a bit for those (including myself) who may feel depressed now)....Nothing particularly/unusually, Pretty much decent intelligence, strong motivations/working/person habits/... 阅读全帖
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)