Help with Jaxb - AnyType access to sub-elements?
Hi All,
I am reading an XML file (defined with XML Schema) using Jaxb.
I need one particular element to hold an arbitrary, but well formed, XML document (with any tags).
As such I've defined this element to be of the type xs:anyType. (See payload)
The AnyType Jaxb class however only appears to be giving me access to the text node strings (not sub-elements). (Notice its don't see <b> needs help </b>)
I need the whole thing so I can pass it on to another parser.
Any ideas? Is this supported in jaxb? Is this supported by XML Schema? Am I doing something wrong?
See details below.
Thanks!
mike
THE SCHEMA:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema elementFormDefault="qualified"
attributeFormDefault="unqualified"
jaxb:version="1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb">
<xs:element name="message" type="message"/>
<xs:complexType name="message">
<xs:annotation>
<xs:appinfo>
<jaxb:class name="XmlMessage"/>
</xs:appinfo>
</xs:annotation>
<xs:sequence>
<xs:element name="from" type="xs:string"/>
<xs:element name="to" type="xs:string"/>
<xs:element name="send-date" type="xs:date"/>
<xs:element name="payload" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
THE DOCUMENT:
<?xml version="1.0" encoding="UTF-8"?>
<message xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="message.xsd">
<from>Mike</from>
<to>Java Community</to>
<send-date>2006-03-23</send-date>
<payload>Mike<b> needs help </b>parsing the AnyType</payload>
</message>
THE CODE:
// get the fields
String from = xmlMessage.getFrom();
String to = xmlMessage.getTo();
Calendar date = xmlMessage.getSendDate();
AnyType payload = xmlMessage.getPayload();
// print out the values
System.out.println("FROM: " + from);
System.out.println("TO: " + to);
System.out.println("DATE: " + date.getTime());
System.out.println("PAYLOAD: " + payload);
// print out details regarding the payload (The AnyType list)
System.out.println("\tAnyType list length = "
+ payload.getContent().size());
for (Iterator i = payload.getContent().iterator(); i.hasNext();) {
Object o = i.next();
System.out.println("\t" + o.getClass() + " : \"" + o + "\"");
} THE OUTPUT:
FROM: Mike
TO: Java Community
DATE: Wed Mar 22 19:00:00 EST 2006
PAYLOAD: org.w3._2001.xmlschema.impl.AnyTypeImpl@1c99159
AnyType list length = 2
class java.lang.String : "Mike"
class java.lang.String : "parsing the AnyType"
Ok.
source message:
root
- node0 (first instance)
--- node1
name="<b>key</b>"
value="<b>my_key_value_1</b>"
--- /node1
--- node1
name="attribute1"
value="attribute1_value"
--- /node1
--- /node0
- node0 (second instance)
--- node1
name="<b>key</b>"
value="<b>my_key_value_2</b>"
--- /node1
--- node1
name="attribute1"
value="attribute1_value"
--- /node1
- /node0
/root
Desired destination message:
root
- node0 (first instance)
- key_value=<b>my_key_value_1</b> <- does exist
--- node1
name="<b>key</b>"
value="<b>my_key_value_1</b>"
--- /node1
--- node1
name="attribute1"
value="attribute1_value"
--- /node1
- /node0
- node0 (second instance)
- key_value=<b>my_key_value_2</b> < should exist but does <u>not</u> exist
--- node1
name="<b>key</b>"
value="<b>my_key_value_2</b>"
--- /node1
--- node1
name="attribute1"
value="attribute1_value"
--- /node1
- /node0
/root
Similar Messages
-
[ETL]Could you please help with a problem accessing UML stereotype attributes ?
Hi all,
Could you please help with a problem accessing UML stereotype attributes and their values ?
Here is the description :
-I created a UML model with Papyrus tool and I applied MARTE profile to this UML model.
-Then, I applied <<PaStep>> stereotype to an AcceptEventAction ( which is one of the element that I created in this model ), and set the extOpDemand property of the stereotype to 2.7 with Papyrus.
-Now In the ETL file, I can find the stereotype property of extOpDemand as follows :
s.attribute.selectOne(a|a.name="extOpDemand") , where s is a variable of type Stereotype.
-However I can't access the value 2.7 of the extOpDemand attribute of the <<PaStep>> Stereotype. How do I do that ?
Please help
Thank youHi Dimitris,
Thank you , a minimal example is provided now.
Version of the Epsilon that I am using is : ( Epsilon Core 1.2.0.201408251031 org.eclipse.epsilon.core.feature.feature.group Eclipse.org)
Instructions for reproducing the problem :
1-Run the uml2etl.etl transformation with the supplied launch configuration.
2-Open lqn.model.
There are two folders inside MinimalExample folder, the one which is called MinimalExample has 4 files, model.uml , lqn.model, uml2lqn.etl and MinimalExampleTransformation.launch.
The other folder which is LQN has four files. (.project),LQN.emf,LQN.ecore and untitled.model which is an example model conforming to the LQN metamodel to see how the model looks like.
Thank you
Mana -
How can I access the sub elements of the Nested Cluster-2
would like to know the label a sub element of a Nested Cluster. I have included the vi. I am trying to programmetically read the Text label of the data elements in Value N mode cluster (Max , Min Mode). I was looking into the Type descriptor document. It can tell me how many and what type of elements are in the cluster. But it does not gove me Refnum to those objects.
Let me know if you have an solution to my question."
Attachments:
cluster_1.vi 24 KBHi
You need to do a recursion. If the reference you get from the array "controls[]" if of type cluster, then you have to loop through recursively.
Openg toolkit has variant tools that might be of some help to you (www.openg.org).
Good luck
PJM
Got EasyXML?
JKI.VIPM.EasyXML.OpenG.LAVA.Builder.blog -
Help with Converting an Access query
Hello:
First time poster and would appreciate some help in converting this Access query into T-SQL so I can use in a Stored Procedure. I don't need help in resolving the syntax for the variables as parameter in the second query, but stuck in writing the first query
in T-SQL . I assume I need some type of nested query with a left join to another query in T-SQL.
How do I convert this from Access into MS-SQL
SELECT TBL_MONTH.L_Month, TBL_MONTH.L_MonthName
FROM TBL_MONTH LEFT JOIN qry_MonthCheck ON TBL_MONTH.L_Month = qry_MonthCheck.L_Month
WHERE (((qry_MonthCheck.L_Month) Is Null));
qryMonthCheck in Access is defined as
SELECT TBL_MONTH.L_Month, TBL_SIGNOFF.SO_YEAR, TBL_SIGNOFF.SO_USER, TBL_SIGNOFF.SO_LOCATION
FROM TBL_MONTH RIGHT JOIN TBL_SIGNOFF ON TBL_MONTH.L_Month = TBL_SIGNOFF.SO_MONTH
WHERE (((TBL_SIGNOFF.SO_YEAR)=[forms]![frm_signoff]![cboyear]) AND ((TBL_SIGNOFF.SO_LOCATION)=[Tempvars]![tmpVarUserLOC]));It is very much up to personal taste. For tables I use no prefix at all. Or suffix. I prefer plural: categories, products, etc. For junction tables, I drop the plural in the first entity, for instance productcategories. As for the case, many people prefer
initial uppercase, while I go for lowercase only. But initial uppercase has its points, particularly in documentation. I am a staunch advocate of using case-sensitive collation for metadata. I don't see any point in mixing productcategories, Productcategories,
ProductCategories etc. That can only cause confusion.
As for either entities, I don't use views much, and I don't have any prefix for these either. In fact, several views I've been involved used to be tables once upon a time.
If you want to add a marker to the object name, I recommend using a suffix. It is much easier to find objects in the version control system and other browser, when not everything is cluttered on the same letter. For instance, I typically add _sp at the end
of stored procedure names.
Erland Sommarskog, SQL Server MVP, [email protected] -
How can I access the sub elements of the Nested Cluster
I would like to know the label a sub element of a Nested Cluster. I have included the vi. I am trying to programmetically read the Text label of the data elements in Value N mode cluster (Max , Min Mode). I was looking into the Type descriptor document. It can tell me how many and what type of elements are in the cluster. But it does not gove me Refnum to those objects.
Let me know if you have an solution to my question.
Attachments:
cluster_1.vi 24 KBI suggest posting this question on the LabVIEW forum. This is the Measurement Studio for Visual Basic forum and there are not nearly as many LabVIEW experts that monitor this forum as the LabVIEW forum.
- Elton -
Here's what I have:
Synology DS212J
Airport Extreme Base Station Gen 4 running latest firmware
Running Lion
Here's what I have done:
Changed NAS to use Manual Configuration. IP set to: 10.0.1.14 (after reading some forums here and there I have now changed this to 10.0.1.202 (to be outside the range of DCHP address)
In Airport Extreme I have configured Port Forwarding for port 80 and 7000 entering the private ip of the NAS 10.0.1.14 and now 10.0.1.202 and filled in the TCP ports with the appropriate port, restarted router.
After reading more posts in the forums I checked the NAS and my Mac Firewalls. Nothing...not turned on. I have since gone back into the NAS Firewall settings after reading a post to allow access for Photostation, File station...just in case it makes a differnece
Obtained a static IP from my ISP - ISP does not block any ports
Canyouseeme.org always gives a Timed out message when I try and check port forwarding
Everything works perfect on LAN...just remote I can't seem to get. Some nice iphone apps I'd like to use remotely and use my Air to access when away from home.
Questions:
Is it necessary to also configure a Static IP on my Airport Extreme...I haven't as my understanding is that only the DS needs one? If I do could some kindly step this out for me?
I have previously changed some settings in my router for unblock-us http://support.unblock-us.com/customer/ ... 27...could this be the problem?
Thanks to anyone that might be able to help. I can post screen shots also or could send privately! I have noted that you must be at an outside computer to test access and of course tried that as well...but understand Canyouseeme.org should still say it can see the open port when I test from my network? I also have a DDNS and everything there shows Normal.
Hoping for something obvious and stupid on my part that someone can point out!so if i understand correctly this should work?
WAN IP 208.160.90.22
router ip address 192.168.1.1
camera ip 192.168.1.200
to access the camera i would type in http://208.160.90.22:1024
thanks greatly! i'm trying to use this camera to monitor a boiler to make sure it's operating in this cold weather we are having... -
Can someone help with some basic answers on Premiere Elements 12
I have used Premiere Elements in the past (up to Premiere Elements 9) but only once per annum to edit the past year's video of my Grandchildren. The change now is that I am using a Panasonic HC-V520 and have been shooting in 1080 50p. Premiere Elements 9 doesn't support this format I believe.
My questions are:
1 Can Premiere Elements 12 import and edit this format?
2 If the answer is yes to question 1, can I mix older footage from my old Sony Camcorder with this newer footage for edit in Premiere Elements?
3 Can I then output to either a Blu Ray disc to play on my DVD Player or an ordinary DVD disc to play on an older DVD Player which is not blu ray compatible?
4 Am I wasting my time in recording in 1080 50p and should I instead be recording new footage in a different format?
Thanks for any help you can give me.1. yes
2. yes
3. No. DVD players can't play BluRay discs -- even if they are burned to a DVD disc.
4. 1080p50 is a perfectly legitimate mode for shooting, particularly if you're shooting video with a lot of action, since it has double the actual frames of 1080i50. However, your output video may or may not actually have 50p frames (or even be 1920x1080), depending on what form of media you're publishing as. The BluRay files that Premiere Elements outputs, for instance are 50i. -
Need help with a Silent Installer for Photoshop Elements 10
I can't seem to get the silent installer working. I've used the Elements 9 instructions for 10 but I still get pop-ups requesting info:
http://helpx.adobe.com/photoshop-elements/kb/silent-install-volume-license-photoshop.html
I cannot find any info at all relating specifically to Elements 10. Before I go digging into the msi with ORCA (preferable to have something I can deploy in Active Directory through GPO) I tought I'd ask here@mtarggart
Delete the blank between /UL and 1033, and it will work. :-)
@Davide M, thanks a lot for your helpful article!
mtarggart wrote:
I've tried the above command and I keep getting prompted to select an Install Language. I'm trying to install this on Windows 7 x64 Enterprise. From an elevated command prompt pointed to the directory of the Elements install files (C:\PSE 10), this is what I am typing: start /wait setup.exe /UL 1033 /V"SERIALNUMBER=xxxx-xxxx-xxxx-xxxx-xxxx".
For the ones who want to use installation from a server share,
change "Setup.exe" by using \\Servername\Share\Setup.exe
and set \\Servername\Share to your Servershare.
The last thing I've been searching for was setting the right country
and stopping PSE from asking me which country I am living in.
Seems as if there was an additional switch e.g. "Country=244" for US. -
Please help with a closed caption or subs solution!
Hi all,
I have been reading up on the various methods of including cc or subs with QT movies but am still a bit stumped as to the best solution for my situation.
We have a desktop application that allows customers to purchase educational videos through branded client catalogs. The videos are downloaded to the customer's Mac or PC and then play back, within our program, utilizing QT player (and we also have the option to switch to MPlayer for older PCs).
Our clients have begun asking if they can also offer alternate versions of their videos with subtitles in various languages. My first thought was this would be a snap, just by adding properly-named and formatted .srt files to the proper directories, and while it seems like this will work if they are using MPlayer, the vast majority of our customers are using QT. Is there a type of text file we can have our clients supply us with that will work automatically in this sense? If not, is there any sort of command-line client we might be able to use to quickly and easily mux mp4 files with cc or subs?
The key here is simplicity, and ideally we would really like to not have to have multiple versions of the mp4s themselves, just having various cc or sub txt files would make everything so much easier!
Is this possible? Am I totally missing an obvious solution?
Thanks so much for any help you can offer!
Best,
Jeffhttp://www.macosxhints.com/article.php?story=20071103080237904
http://forums.macrumors.com/showthread.php?t=282408
NicePlayer mentions subtitle support in the help menu -
Help with public function (accessing to addchild object from other public function)
Hi, i have below piece of my code AS3 (Flash CS4). I would like to get access to addchild Movie Clip object (ZoltyWjazdMC) in function two() which i created by addchild command in public function one(). I know it`s basic question but i can`t find answer for it. Anybody would help me with that?
public function one():void
var ZoltyWjazdMC:MovieClip = new MovieClip();
this.addChild(ZoltyWjazdMC);
ZoltyWjazdMC.addChild(assets.ZoltyWjazd.loader);
this.setChildIndex(ZoltyWjazdMC,1);
ZoltyWjazdMC.alpha = 0;
ZoltyWjazdMC.visible = true;
assets.ZielonyWjazd.alpha = 1;
public function two():void
ZoltyWjazdMC.alpha = 1;
Do i need remove "this" and change it to "stage". Is it necessary?Define your variable var ZoltyWjazdMC:MovieClip outside of function one(). Currently ZoltyWjazdMC is local to function one() so that function two() does not understand what it is!
-
Request help with restricting site access
I have posted before, and received a mix of condescension and
such, but I am okay with that. I know very little about web design,
but I am willing to learn.
I built a website for my lab (home.uchicago.edu/~beilock) and
the professor for whom I work would like a password protected
portion of the site. Previous advice led me to try PHP/MySQL (for a
newbie like me, these terms were foreign), and I downloaded and
followed all of Dreamweaver's help section and to no avail (it says
cannot connect to FTP host)...and I have tried many things to fix
that, but could not.
Anyway, so this post is for multiple purposes. 1.
Opinions/Advice on the website; 2. Solutions to my connection
problem; 3. simpler alternatives to making a site restricted (I
know nothing of ColdFusion, but if it is easier, please let me
know)
I don't mind being condescended to or berated if you help me
out successfully, in fact, let that be your motivation.
Any help appreciated,
JamieUse coldfusion it is the best out there/ quick and easy to
learn. Check out easycfm.com (they have a great tutorial about
security and restricting access)and post any questions there or on
the adobe coldfusion forum.
If you don[t know anything thenm the quickest language to
learn is coldfusion. You then have to decide if you are going to
use access database or mysql. If it is a huge site use mysql if not
use access. Access is like excel and is easy to use, mysql you will
need to use a program like navicat (google it) to connect to the db
and be able to display it like access. They both come with nearly
all hosts. Who does your hosting ask them how to connect via ftp.
You will need a username, password and hostname as minimum. I
imagine you arent trying to connect to RDS at this stage most hosts
dont allow this(remote development)
Well Good luck!! -
Trouble with shares and access to sub folders
We're attempting to replicate our Netware configuration to a new MacOS 10.4.6 server. On Netware we where able to create a share that was available to all users, however the folders they saw within the share where governed by their access rights within the tree. For example, take the following structure:
Data --+-- Folder1
|
+-- Folder2
Rights for Folder1 where assigned to Group1 and rights to Folder2 to Group2. All users in Group1 and Group2 could then mount the drive and see the folders that they where a member of.
We have attempted to replicate this on MacOS as follows:
Data --+-- Folder1 (ACL Group1 = Read/Write)
|
+-- Folder2 (ACL Group2 = Read/Write)
However, when you mount Data on Mac or Windows it says you have no access rights and won't let you dig down to Folder1 or Folder2. Is there something I'm missing?If all users in Group 1 and Group2 have access to
the root Data folder then that permission will
propogate down the tree and they will have read
access to each of the sub folders. If folders within
suddenly gain everyone RW access then they will be
able to open and see the folder.
Thanks, I've solved the problem. I needed all users to have access to the root of the 'volume' but for that not to propogate down the tree. I've found the inheritence settings and that I think has solved the problems.
You can control this by propagating permissions
downward from the top level folder. Do this:
Create a group for everyone who accesses Data called
DataGroup.
Add DataGroup to the group list for everyone. (You
can mass select Users and add the group to everyone
who needs it at once.)
Change the Unix group owner of the Data folder to
DataGroup and set these permissions:
Owner: admin RW, Group: DataGroup R, Everyone: None
Open Data and set Folder1 privileges to:
Owner: admin RW, Group: Group1 RW, Everyone: None
and propagate these settings to the subfolders. Be
sure to propagate Group Ownership and Group
Permissions and Everyone permissions.
NOTE: This is the traditional *nix way - with ACLs
you can do this and then fine-grain the control using
the ACL granting Group 1 Full Control and propagating
that.
Now set Folder2 to Group2 etc.
This allows you access to Data (versus using staff or
some generic Unix group but those will work too) but
allows you to control who has access to the
subfolders. In this case membership in DataGroup only
grants you access to see the folders - it doesn't
even guarantee access to any of the subfolders.
If you want nested folders within Folder1 or Folder2
you can do the same thing - create a folder owned by
a specific user and set Group Read access to none and
propagate that through the subtree. Just be aware
that propagations that happen above that folder can
reverse the settings. Always set large and then get
specific. New Users are granted access to Data by
adding DataGroup and users access to folders are
granted or revoked by adding or removing the Group1,
Group2 etc settings.
I think that once you get it set how you want and try
it you'll find that the Data folder is redundant and
is giving you unnecessary conceptual problems. If you
make the Folder1, Folder2 etc shares then after a
user authenticates they will see only the folders
they have permission to access. If I am in Group1 and
I authenticate my selection of folders will only be
folders accessible by Group1 - I will never even see
Folder2. By grouping them in Data you are adding a
layer of permissions that is probably not needed. But
everyone has their own organizational system and
sometimes it's easier to leave users with what their
used to using. (I have users that still mount Users
and navigate to their own folder even though their
user folder shows up at the login level simply
because that's the way they've always done it.)
No there are good reasons to share the Data folder and not the children below. For example, if you are on Windows clients and you wish to map the share to a drive letter you will have no way of doing this if you don't have the containing folder.
Yes, I understand with ACLs (or at least I think I
do and have setup a system that works). The problem
is that new folders get Everyone Read access. Which
ruins the effective permissions for that folder. I
need a way of making the default posix permissions
O=RW,G=None,Everyone=None.
We have a lot of folders to deal with Folder 1 and
Folder 2 are only examples. We have about 15 or more
folders with sub folders that have differing access
rights. All this we have sorted out except the
default POSIX permissions for new folders/files.
You can change Umask default privilege settings but
DON'T. Well, DON'T unless you're a *nix guru. It
changes the default for all created files - including
those created by the system and this can lead to
serious problems down the road.
I don't want a whole system default change to umask I want one that works only for people connected via AFP, you would think that would be possible. Similarly I want one for SMB access also.
If you get this working you will see that despite the
POSIX settings the ACLs are working. If you really
need your Unix permissions to be set a certain way
chuck ACLs and set "Inherit from Parent Folder" in
AFP and SAMBA. With ACLs on the system will only do
POSIX settings.
In the windows world you either use POSIX or ACLs in the mac world you use a combination of both. That can be an asset but it can also be a major problem. If only you could use the inherit setting for POSIX when ACLs where enabled it would solve all these worries.
Thanks for your time on this.
Ian -
Need help with a lookup on a IDoc element for BPM
Hello All,
I was wondering if there is someway that I can lookup on the <b>E1EDKA1</b>segment and get the value of <b>NAME1</b> where the value of <b>PARVW = LF</b> in BPM. I appreciate any help.
Thanks
Message was edited by:
Balu YalamanchiliHI,
To get value of element/container variable , you cna use first context object, based on context object put switch (aslo some block/fork step ) with condition , stating that if that value of context element is matched then put control step to raise alert.
i think you got this ,if not please let me know to explain clearly.
Any way please see some links regarding alert..
/people/krishna.moorthyp/blog/2006/04/08/reconciliation-of-messages-in-bpm
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
Regards
Chilla.. -
I need some help with MIDI and accessing samples
I recently purchased Logic Express 9. I'm really happy with it--it's certainly a step up from Garageband--but I'm having trouble connecting my MIDI keyboard. In Garageband, I was able to just plug the keyboard in using a MIDI/USB cable and play software instruments immediately. But in Logic, when I connect the keyboard (a Yamaha PSR-273) into a USB port, it doesn't even register! Right now, the only way for me to play software instruments is through the Capslock keyboard, and I would prefer to play on real keys. How can I connect my keyboard so I can play Logic software instruments?
Also, I read on the Apple website for Logic Express that there are "More than 1000" sampled EXS instruments, including "strings, horns, woodwinds, guitars..." etc. The only EXS instruments that I've been able to find are synthesizers. Where are the other EXS instruments and how can I access and use them?Make sure that the keyboard is turned on before you launch Logic.
In the system preferences of the computer is it connected?
In the preferences of Logic, does it give you an option in the audio section to use the driver in your keyboard? That should come up if its connected -
Help with "open for access" error
Why am I getting file wasn't found error here? (The file is on the desktop).
try
-- set myPrefsFile to (choose file with prompt "Select a file to read:" of type {"TEXT"})
open for access (file "10.3.9:desktop:myFile")
set fileContents to (read file "10.3.9:desktop:myFile")
close access file "10.3.9:desktop:myFile"
display dialog fileContents
on error Error_Message
display dialog Error_Message
end try
Lennox1. You need to specify the correct path and extension. For example:
10.3.9:Users:username:Desktop:myFile.txt
2. You shouldn't need to use 'open for access' if you're only going to read the file.
I don't have any additional suggestions for your other script.
(36335)
Maybe you are looking for
-
Hi, Payment terms is maintained in Vendormaster and got copied when created PO but when invoice is made payment terms field is zero, Can someone please tell why? Regards Arun
-
Is it good idea to store video files in database?
Hi, In my project I am storing everything in database BLOB column. Everything includes images,documents,videos and any thing uploaded from form. Someone suggested me that video should not be save in database. I want to know it is good idea to store e
-
Forecast for planning over the Cost element/Cost center with KP06
Hi all I'm searching a idea: one of our chief controller need to insert a "forecast" of budget inserted over the various cost elements/cost centers using the transaction KP06. THe problem is that he don't want lost the budget because he can need the
-
Newbie: Starting an Oracle Database on Linux
I am doing support for an Oracle Database installed on Red Hat. My problem is that I do not know how to start the oracle database. I had to reboot the Linux box and the database did not restart. What do I need to do to start the database? Also the Li
-
Extended IDOC for transaction VL02N : Error 51
Dear, I am Working on Extended IDOC for transaction VL02N (Outbound Delivery) and stuck in Inbound with Error 51: Specifications for units and quantities contain errors VBPOK-MEINS TO LIPS-MEINS MT. Message no. VL282 How to resolve it? At Outbound Pr