|
What is the best way to go about parsing XML in Java? I've been going about rewriting a project I have written, and it uses the org.w3c.dom.* classes to do so. This was mainly because I found information on it, but with all things Java it seems like there is a lot of outdated information out there. Basically, whats the best API for doing this, since any way I can simplify the code for this project would be extremely helpful.
|
# ¿ Mar 26, 2008 14:16 |
|
|
# ¿ May 6, 2024 20:47 |
|
zootm posted:It entirely depends on what you want to do, and what your requirements are. Java has support for pretty much every method of parsing XML out there. Thanks for the information. This really helps me out, since I have been having difficulties locating the information I needed. It looks like I will be sticking with DOM, since my documents will never be excessively large and I am going to be parsing the XML generated from a program that makes a simple task extremely difficult due to it creating two separate nodes that contain slightly overlapping information by using reference IDs to identify the correlation.
|
# ¿ Mar 26, 2008 15:00 |
|
tef posted:If you are just rewriting the output of a program from xml to xml, there are other options like xpath+xsl. I'm not sure, the way this works is fairly obtuse, such as code:
|
# ¿ Mar 27, 2008 12:50 |
|
I have a question that deals with Hibernate + Spring. I am working on a project that has two types of users. One is a parent, one is a child. A parent can register and create a new account and log in. Then, a parent can also create child users, which it has control to add and delete. These users can then log in. How can I safely protect the user accounts from the client but still allow for this relationship in the ORM? The main issue is that I'd be serializing this collection to the client, which would then expose all these Account classes. EDIT: I guess I should have clarified this, but my biggest concern is returning the password field to the client, which I would like to avoid doing. CRIP EATIN BREAD fucked around with this message at 22:39 on Feb 15, 2010 |
# ¿ Feb 15, 2010 22:16 |
|
Mill Town posted:Use a one-way hash on the passwords? I'm currently hashing with a salted MD5, but I still would prefer to not even send that back to the user. However, I think I figured out what I needed to do, it turns out that my externalizer/serializer has an ability to ignore fields in an entity bean, so I am ignoring the password field and setting and creating a separate service call for updating the password.
|
# ¿ Feb 16, 2010 13:18 |
|
|
# ¿ May 6, 2024 20:47 |
|
TRex EaterofCars posted:Can't you just mark the field transient (or @Transient) and it won't be sent with the bean data? This will cause it to not be persisted into the database. But as I mentioned above, I had to do it through the externalizer that was serializing the data over an AMF channel.
|
# ¿ Feb 19, 2010 17:11 |