New XML Training Announced
Just as a heads up for Oracle users on the east coast:
A new XML Publisher Training course has been announced for New York City, NY. Previously the only course being offered in the Northeast was in Boston, MA.
They are actually great.
<img border="0" src="http://storeyourpicture.com/images/signature_electronics.jpg">
Similar Messages
-
Help with creating a new XML file from an existing DOM tree!!
i want to create a new XML file from an existing DOM tree
i used this code to create a new document:
static public Document createDocument(String fileName) throws ParserConfigurationException//,IOException,SAXException
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setIgnoringComments(true);
factory.setIgnoringElementContentWhitespace(true);
factory.setValidating(true);
DocumentBuilder builder =factory.newDocumentBuilder();
return builder.newDocument();
// handle exception creating DocumentBuilder
catch ( ParserConfigurationException parserError ) {
throw new ParserConfigurationException();
}then i used this code to transform the DOM :
public void exportDocument(Document document) {
try {
Source xmlSource = new DOMSource( document );
Result result = new StreamResult( System.out );
TransformerFactory transformerFactory =
TransformerFactory.newInstance();
Transformer transformer =transformerFactory.newTransformer();
transformer.setOutputProperty( "indent", "yes" );
transformer.transform( xmlSource, result );
//then catching the exceptions
But the file was not created and i didn't find where can i specify the DTD that the XML file should use and where can i enter the name of the XML file itself
Another questoin can i write a DTD file dynamically during the execution of the program??Cross-post: http://forum.java.sun.com/thread.jspa?threadID=784467&messageID=4459240#4459240
-
How to create new XML file using retreived XML content by using SAX API?
hi all,
* How to create new XML file using retreived XML content by using SAX ?
* I have tried my level best, but output is coming invalid format, my code is follows,
XMLFileParser.java class :-
import java.io.StringReader;
import java.io.StringWriter;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.sax.TransformerHandler;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.XMLFilterImpl;
public class PdfParser extends XMLFilterImpl {
private TransformerHandler handler;
Document meta_data;
private StringWriter meta_data_text = new StringWriter();
public void startDocument() throws SAXException {
void startValidation() throws SAXException {
StreamResult streamResult = new StreamResult(meta_data_text);
SAXTransformerFactory factory = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
try
handler = factory.newTransformerHandler();
Transformer transformer = handler.getTransformer();
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
handler.setResult(streamResult);
handler.startDocument();
catch (TransformerConfigurationException tce)
System.out.println("Error during the parse :"+ tce.getMessageAndLocation());
super.startDocument();
public void startElement(String namespaceURI, String localName,
String qualifiedName, Attributes atts) throws SAXException {
handler.startElement(namespaceURI, localName, qualifiedName, atts);
super.startElement(namespaceURI, localName, qualifiedName, atts);
public void characters(char[] text, int start, int length)
throws SAXException {
handler.characters(text, start, length);
super.characters(text, start, length);
public void endElement(String namespaceURI, String localName,
String qualifiedName) throws SAXException {
super.endElement("", localName, qualifiedName);
handler.endElement("", localName, qualifiedName);
public void endDocument() throws SAXException {
void endValidation() throws SAXException {
handler.endDocument();
try {
TransformerFactory transfactory = TransformerFactory.newInstance();
Transformer trans = transfactory.newTransformer();
SAXSource sax_source = new SAXSource(new InputSource(new StringReader(meta_data_text.toString())));
DOMResult dom_result = new DOMResult();
trans.transform(sax_source, dom_result);
meta_data = (Document) dom_result.getNode();
System.out.println(meta_data_text);
catch (TransformerConfigurationException tce) {
System.out.println("Error occurs during the parse :"+ tce.getMessageAndLocation());
catch (TransformerException te) {
System.out.println("Error in result transformation :"+ te.getMessageAndLocation());
} CreateXMLFile.java class :-
Sax.startDocument();
Sax.startValidation();
Sax.startElement("", "pdf", "pdf", new AttributesImpl());
Sax.startElement("", "basic-metadata", "basic-metadata", new AttributesImpl());
String xmp_str = new String(meta_data.getByteArray(),"UTF8");
char[] xmp_arr = xmp_str.toCharArray();
Sax.characters(xmp_arr, 0, xmp_arr.length);
Sax.endElement("", "pdf", "pdf");
Sax.endValidation();
Sax.endDocument();
Sax.endElement("", "basic-metadata", "basic-metadata");* In CreateXMLFile.java
class, I have retreived the xml content in the meta_data object, after that i have converted into character array and this will be sends to SAX
* In this case , the XML file created successfully but the retreived XML content added as an text in between basic-metadata Element, that is, retreived XML content
is not an XML type text, it just an Normal text Why that ?
* Please help me what is the problem in my code?
Cheers,
JavaImranSax.startDocument();
Sax.startValidation();
Sax.startElement("", "pdf", "pdf", new AttributesImpl());
Sax.startElement("", "basic-metadata", "basic-metadata", new AttributesImpl());
String xmp_str = new String(meta_data.getByteArray(),"UTF8");
char[] xmp_arr = xmp_str.toCharArray();
Sax.characters(xmp_arr, 0, xmp_arr.length);
</code><code>Sax.endElement("", "basic-metadata", "basic-metadata");</code>
<code class="jive-code jive-java">Sax.endElement("", "pdf", "pdf");
Sax.endValidation();
Sax.endDocument();
* I HAVE CHANGED MY AS PER YOUR SUGGESTION, NOW SAME RESULT HAS COMING.
* I AM NOT ABLE TO GET THE EXACT OUTPUT.,WHY THAT ?
Thanks,
JavaImran{code} -
IS IT POSSIBLE 2 BUILD A NEW XML FROM DAMAGED ITL? SAVE FERRIS
OK. Here's my situation. I have an HP notebook running on VISTA. ITUNES version 8.1.1....... My computer shut off abruptly while I was running ITUNES and after I restarted it and started up Itunes, I got the damaged ITL message. No big deal, I still have all my songs in their designated folder and I'll just import the XML to get all my playlists back in action. I've done this at least 10 times already. Works like a charm everytime. Oh S#!T,... my XML was wiped out during the shut down. I have a program that can retrieve files after recycle bin deletion and the XML is no where to be found. SOOOOOO here's my questiion. When my computer S#!Ted in my cereal, it split my ITL into two seperate damged ITL's. One 32 MB and the other 14 MB. I know the XML is just a backup of the ITL and I frequently update my XML twice a week to make sure no B.S. could bestow it's bad self all up in my shizz. I just never figured to make a copy of the XML because everytime this has happened, the good XML was always there to use. (NOW I KNOW)Soooo, I need to know how to build an new XML from the two damaged itl's. That way I can just import the two new xml's and then save, thus making itunes create a new fresh XML from my two provided and restoring my itunes to it's original self. My problem is I can't get ITUNES to read my two damaged ITL's. Yes, I've done the name change method, no love. I tried the restart computer at a previous date and time method, didn't work. I tried the previous libraries folder and it's five moths old, which is a 10,000 song difference for me. So that way is useless. I even downloaded the same version of ITUNES that I run onto my home computer, which runs on XP, so I could try the system cache method. No love there either. I've stumbled upon a page where a person stated that they were able to manually poke around with their ITL file and forcing ITUNES to repair it. However this person was a computer whiz and I am sooooo totally not. So I had no idea what he was talking about. Anyone dealt with this scenario before? I tried praying to GOD but all he said was "THAT'S WHAT YOU GET FOR PUTTING SHANIA TWAIN'S ..THAT DON'T IMPRESS ME MUCH.. ON YOUR IPOD YOU F%#KING DORK!!!" and I was like, "dude, it is undeniably impossible to not have a smile on your face for the duration of that righteous classic. Then he just f@rted into his hand and released it an inch away from my nostrils, followed by some bird flippage and nut sack grab. So I'm gonna need some help with this one. Thanks Ahead
How to Transfer Everything from an Old iPad to New iPad
http://osxdaily.com/2012/03/16/transfer-old-ipad-to-new-ipad/
iOS: Transferring information from your current iPhone, iPad, or iPod touch to a new device
http://support.apple.com/kb/HT2109
Moving Content to a New iPad
http://tinyurl.com/qzk2a26
How to Transfer App Data and Game Saves from One iOS Device to Another
http://lifehacker.com/5891964/can-i-transfer-app-data-and-game-saves-from-my-iph one-to-a-new-ipad
How to transfer data from your old iPad to your new iPad
http://www.imore.com/how-transfer-data-your-old-ipad-your-new-ipad-air-or-retina -ipad-mini
Transferring your prepaid cellular data account depends on your carrier. AT&T lets you move it yourself when you go to Cellular Data in Settings and log into your account with your previous AT&T user name and password. For iPads with Sprint service, you can set up an account on the new iPad and contact Sprint Customer Care (888-211-4727 and go through the menus) to deactivate the old plan and get credit for unused service. For Verizon, call the company’s customer service number for mobile broadband support (800-786-8419) and ask to have your account transferred.
Cheers, Tom -
Loading new xml data into a already xml populated image display
Hi everybody,
I have a question about loading new xml data into a already xml populated image gallery.
So I have my gallery set up so it calls some xml when it first loads. What I would now like to do is load different sets of images via a different xml sheet via the click of a button.
So for example the loaded gallery already has all thumbs loaded and user can click on them to view the full size image. So next instead of the user having to close this gallery to allow a new gallery to open with a different set of pictures I would just like to have a button. This button will unload the existing thumbs from the gallery and load in new ones from a different xml file.
If anybody can help me with this it would be great as I am still on a steep learning curve with AS3.
Here is my AS3
var xmlPath:String = "pictures.xml";
var xml:XML;
var loader = new URLLoader();
loader.load(new URLRequest(xmlPath));
loader.addEventListener(Event.COMPLETE, xmlLoaded);
function xmlLoaded(e:Event):void
if ((e.target as URLLoader) != null )
xml = new XML(loader.data);
createMenu();
var numberOfItems:uint = 0;
var menuItems:Array = new Array();
function createMenu():void
numberOfItems = xml.items.item.length();
var count:uint = 0;
for each (var item:XML in xml.items.item)
var imageLoader=new Loader();
var menuItem:MenuItem = new MenuItem();
menuItem.addChild(imageLoader);
imageLoader.load(new URLRequest(item.url));
menuItem.linkTo = item.linkTo;
menuItem.mouseChildren = false;
menuItem.addEventListener(MouseEvent.CLICK, itemClicked);
menuItems.push(menuItem);
addChild(menuItem);
count++;
function ***():void
//menuItems.sortOn("zpos3D", Array.NUMERIC | Array.DESCENDING);
for (var i:uint = 0; i < menuItems.length; i++)
setChildIndex(menuItems[i], i);Thanks so much for the reply Andrei1
I think maybe my lack of knowledge when it comes to AS3 is not helping me at the moment because I thought I understood the code you supplied but there is something not going quite right.
So I messed around with the code and added the new_loaded_thumbs_btn to load in the "new_pictures.xml" but I am def doing something wrong.
import flash.ui.ContextMenuItem;
var xmlPath:String = "pictures.xml";
var xml:XML;
var numberOfItems:uint = 0;
var menuItems:Array = new Array();
var loader = new URLLoader();
loader.addEventListener(Event.COMPLETE, xmlLoaded);
loadXML("pictures.xml");
new_loaded_thumbs_btn.addEventListener(MouseEvent.CLICK, loadXML);
function loadXML(path:String):void {
loader.load(new URLRequest("new_pictures.xml"));
function loadXML(path:String):void {
loader.load(new URLRequest(path));
function xmlLoaded(e:Event):void
xml = new XML(loader.data);
createMenu();
function createMenu():void
clearMenu();
numberOfItems = xml.items.item.length();
var count:uint = 0;
var imageLoader;
var menuItem:MenuItem;
for each (var item:XML in xml.items.item)
imageLoader = Loader();
menuItem = new MenuItem();
menuItem.addChild(imageLoader);
imageLoader.load(new URLRequest(item.url));
menuItem.linkTo = item.linkTo;
menuItem.mouseChildren = false;
menuItem.addEventListener(MouseEvent.CLICK, itemClicked);
menuItems.push(menuItem);
addChild(menuItem);
count++;
sortChildren();
// removes previously placed objects
function clearMenu():void {
var menuItem:MenuItem;
while (menuItems.length > 0) {
menuItem = menuItems[0];
removeChildAt(getChildIndex(menuItem));
menuItem.shift();
function sortChildren():void
//menuItems.sortOn("zpos3D", Array.NUMERIC | Array.DESCENDING);
for (var i:uint = 0; i < menuItems.length; i++)
setChildIndex(menuItems[i], i);
When the image display 1st loads it displays the new_pictures.xml thumbs which I thought would load through my new button when clicked.
And there was me thinking I was getting the hang of AS3.
Could you please point me in the right direction in what I am doing wrong,
Thanks for your time and effort in advance -
Does creation of new xml file captures latest value?
HI All,
say for instance, if web port has been changed from 8000 to 80 and after this change xml file gets corrupted in apps tier...
Does creation of new xml file in apps tier captures latest value of web port 80 and all other latest changes made so far?
Thanks for your time...HI All,
say for instance, if web port has been changed from
8000 to 80 and after this change xml file gets
corrupted in apps tier...
Does creation of new xml file in apps tier captures
latest value of web port 80 and all other latest
changes made so far?
Thanks for your time...If autoconfig is not run after the changes are made to the context file, and the file is lost then the changes are lost. -
Updating Clip metadata with new XML?
Hey All,
I have a bunch of clips that I'm using with minimal metadata. I've received a NEW XML with extensive metadata for the same clips. I would like to append the new metadata to the clips that I'm already using in the project. Is there a way to do this without having to replace all of my edits?
Thanks,
JThe freeze frames are independent of the clip you made them from. You'll have to do them all again.
rh -
Hi
there are many samples about reading results into xml, but how can the oracle xml parser be used to create a xml document (String) from the scratch?
Thanks a lot for suggestions
DanielThanks , but i know all this !
File corFile = new File("e:\\corFile.xml");
DOMParser dp=new DOMParser();
InputStream is = new FileInputStream(corFile);
XMLDocument root=XMLHelper.parse(is,null);
is.close();
Element hello = root.createElement("hello");
Text bonjour = root.createTextNode("Bonjour");
hello.appendChild(bonjour);
root.appendChild(hello);
i know how i can update the XMLDocument ,
but how i can update my file corFile.xml ??
i would create a new xml file from my new XMLDocument ! -
How do i get new xml back from edited DOM
i parsed XML to get the DOM and then i edited the dom now how do i get the new XML back from the edited DOM ?????????
thanx
samIt's not nearly as straight-forward as it should be, but check out the javax.xml.transform package (assuming you're using JDK 1.4).
I think Xerces has simpler methods for doing this, but I wrote my own serializer class ages ago, and tend to use that.
RObin -
Pls suggest for new xml flow in InDesign...
Hi everyone,
we have pitched into the new xml workflow in InDesign. Basically it looks like Pearson ETM XML workflow followed in Quarkxpress.
Please go through this sample pearson xml coding followed in quark:
DUE TO PROBLEM IN POSTING WE HAVE CHANGED < > AS [ ] IN ALL TAGS.
[unitPart id=c01-upt-0001]
[title]Defining the Realm[/title]
[sect1 id=c01-sec1-0001]
[title]Geographical Features[/title]
[p]As Figure [xref target=c01-fig-0001/] shows, For many centuries Europe has been a hearth of achievement, innovation, and invention.[figureAnchor figures=c01-fig-0001/][/p]
[sect2 id=c01-sec2-0001]
[title][huc]E[/huc]uropes Eastern Border[/title]
[p]The European realm is bounded on the west, north, and south by Atlantic, Arctic, and Mediterranean waters, respectively.Chapters [anchor id=c01-anc-0001/] and [anchor id=c01-anc-0002/].[/p][/sect2]
Here our customer asked to proceed the same above xml structure in InDesign.
For example: in above xml [title] tag comes under [sect1] tag as well as [sect2] tag. In Quarkxpress, we can control this [sect1] after [title] tag as [H1] style and [sect2] after [title] tag as [H2] style and so on through CPL rules.
Here we struggle to follow the above process with InDesign. Because in InDesign if we pour the above xml the [title] tag should treated as [title] style only.
So please guide and help us whether it is possible to follow the above xml process in InDesign....
Thanks in Advance
ThiyaguIt's one of the major differences between Quark and ID.
ID has a "paragraph composer" as will as a single line composer like Quark's, and it's on by default. When you use the paragraph composer the text is constantly analyzed and spacing adjusted for the best fit and appearance (according to the spacing algorithm and your justification settings) for the entire paragraph. If you force a line break, ID may adjust all the lines above as well as the lines that follow.
If this is a "serious problem" you shoud probably witch to the single line composer. You'll find a drop down for it in the paragraph style definitin dialog under the Justification settings, or you can change an individual paragraph as a local override from the Control panel flyout menu.
Most of us whove been ID users for some time find the paragraph composer to be one of the strenghts of ID, and feel it generates nicer looking text than a single line composer. -
Problem with "Add new xml schema"
Hi,
When i add a new xml schema to my repository, the Console stop responding.
It happens for all repository. Have any clue why?
I am using MDM SP05 5.5.42.48
Thanks in advance for you help
Best regards,
Arun prabhu SHi Arun,
Kindly visit the following links:
[http://help.sap.com/saphelp_mdm550/helpdata/en/42/e9cfa1d2e23ee6e10000000a1553f7/frameset.htm]
[http://help.sap.com/saphelp_mdm550/helpdata/en/fe/8aa2bbdb0d41a0a6b37194ea614f11/frameset.htm]
[http://help.sap.com/saphelp_mdm550/helpdata/en/7a/d536f2aae04747b1f48afbff4834b1/frameset.htm]
Hope it will suffice to hint you.
With warm regards,
Krutarth -
It looks like you currently cannot add a new XML Schema under the XML Database node.
Can you paste the XML Schema that you tried to create to the forum ?
Also, did you try to create a global or a local xml schema ?
thanks,
Chithra -
How to add new xml item(BAPI requset)?
Hello
i want to create bom to ERP from mii
how to add new xml item(BAPI requset)?
i use bapi CAD_CREATE_BOM_WITH_SUB_ITEMS
this bapi's format is
<table>
<item>
<col1>1111</col1>
<col2>bbbb</col2>
</item>
</table>
i want to add <item>
like this
<table>
<item>
<col1>1111</col1>
<col2>bbbb</col2>
</item>
<item>
<col1>22222</col1>
<col2>bbbb</col2>
</item>
</table>
how to set trx?
i tryed
SAP_JCo_Interface_0.Request{/CAD_CREATE_BOM_WITH_SUB_ITEMS/TABLES/BOM_ITEM/item[2]/SORTF}
when error occured
use MII12.0
Edited by: Atsushi Iwasaki on May 18, 2010 6:22 AMHi,
You can try this alternative
Step 1) Create XML Document with required structure which you want to pass it to BAPI request.
Step 2) Populate the XML Row with required contents and map it to above created XML document
Step 3) Map above created XML Document to BAPI request (use assign XML option dfrom link editor rather tha assign value)
This will help to map dynamic contents to your BAPI request.
Regards,
Shalaka -
SAX: How to create new XML file using SAX parser
Hi,
Please anybody help me to create a XML file using the Packages in the 5.0 pack of java. I have successfully created it reading the tag names and values from database using DOM but can i do this using SAX.
I am successful to read XML using SAX, now i want to create new XML file for some tags and its values using SAX.
How can i do this ?
Sachin KulkarniSAX is a parser, not a generator.Well,
you can use it to create an XML file too. And it will take care of proper encoding, thus being much superior to a normal textwriter:
See the following code snippet (out is a OutputStream):
PrintWriter pw = new PrintWriter(out);
StreamResult streamResult = new StreamResult(pw);
SAXTransformerFactory tf = (SAXTransformerFactory) TransformerFactory.newInstance();
// SAX2.0 ContentHandler.
TransformerHandler hd = tf.newTransformerHandler();
Transformer serializer = hd.getTransformer();
serializer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");//
serializer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM,"pdfBookmarks.xsd");
serializer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM,"http://schema.inplus.de/pdf/1.0");
serializer.setOutputProperty(OutputKeys.METHOD,"xml");
serializer.setOutputProperty(OutputKeys.INDENT, "yes");
hd.setResult(streamResult);
hd.startDocument();
//Get a processing instruction
hd.processingInstruction("xml-stylesheet","type=\"text/xsl\" href=\"mystyle.xsl\"");
AttributesImpl atts = new AttributesImpl();
atts.addAttribute("", "", "someattribute", "CDATA", "test");
atts.addAttribute("", "", "moreattributes", "CDATA", "test2");
hd.startElement("", "", "MyTag", atts);
String curTitle = "Something inside a tag";
hd.characters(curTitle.toCharArray(), 0, curTitle.length());
hd.endElement("", "", "MyTag");
hd.endDocument();
You are responsible for proper nesting. SAX takes care of encoding.
Hth
;-) stw -
I have an application that first creates an XML file from the
database and then redirects to another page which loads the spry
regions from the newly created XML file. The problem I have is
that, the first time this works fine, but if I select another
record from the database, even though the new XML file has been
created correctly when you are redirected, the old data is
displayed. It doesn't load the new XML data.I don't really have the answer to this issue but, I will say
in my experience, XML based apps are notorious for caching old
info. It's really pathetic actually. I experienced this with a
simple static XML file used on a page with SPRY regions and the
issue would not stop. I eventually discovered an obscure solution
revolving around the use of generating a random numbers with each
call to force the browser to load the new data. Hope this points
you in a useful direction.
Maybe you are looking for
-
Reading .jpeg files in FILE or FTP adapter
Hii I have to send .jpeg files at regular intervals using BPEL. I read about Base64 data type. I tried to create File Adapter and FTP adapter. I specified the folder location and *.jpeg as file pattern. I have made schema to opaque. But neither File
-
How to import an .csv file into the database?
and can we code the program in JSP to import the.csv file into the database.
-
Application Availability Monitoring -- Best Practice?
What are you using to monitor application availability? Thinks like making sure that Essbase, Planning, FR, Workspace, FDM, and HFM are up, and responding to requests in a timely manner. Do Hyperion Management Packs exist for MS System Center Operati
-
[Install Agent on DMZ] How to trouble shooting AMAgentNotRespondingOnDMZHost exception
We have a hyper-v server in DMZ and trying to add it into VMM 2012 R2 for management followed by http://technet.microsoft.com/en-us/library/gg610642.aspx As the 443 port has been used ,we changed the port to 5985,5986 and also update port on VMM Serv
-
What priviliges need to Run Discoverer Desktop
Hi all, I have installed Discoverer Desktop on client machine. When I login throug the administrator on any client machine then I can connect to Desktop. But unable to connect to Discoverer Desktop on client machine when I connect with my personal ID