Javascript create parent xml element from selection
Hello,
With help from these forums I finally learned how to script creating a parent xml element from a selection in the Structure Pane.
var myDoc = app.activeDocument;
var mySel = app.selection;
var newParent = myDoc.xmlElements[0].xmlElements.add({markupTag:"c_bullet_list"}).move(LocationOptions.before, mySel[0]);
var i = mySel.length;
while(i--){
mySel[i].move(LocationOptions.AT_BEGINNING, newParent);
Hope this helps somebody.
Use placeXML instead of move().
var myXMLElementA = app.selection[0];
var myTextFrameA = app.activeDocument.pages[2].textFrames.add({geometricBounds:[0, 0, 160, 160], contents:" "});
myXMLElementA.placeXML(myTextFrameA);
Shonky
Similar Messages
-
Create a xml file from an internal table: CALL TRANSFORMATION
Hello gurus,
I want to create a xml file using data from scustom table. I will create an internal table and will select some records to it.
I searched the forum and i discovered the call transformation, but when i execute the example program at the CALL TRANSFORMATION shows a dump screen.
How we create a xml file from internal table??
Please help me. I will mark the useful answers.I'm using if_ixml class to create xml documents
TYPES: BEGIN OF xml_line,
data(256) TYPE x,
END OF xml_line.
DATA: o_ixml TYPE REF TO if_ixml,
o_document TYPE REF TO if_ixml_document,
o_element TYPE REF TO if_ixml_element,
o_streamfactory TYPE REF TO if_ixml_stream_factory,
o_ostream TYPE REF TO if_ixml_ostream,
o_renderer TYPE REF TO if_ixml_renderer.
DATA: t_xml_table TYPE TABLE OF xml_line,
v_xml_size TYPE i.
o_ixml = cl_ixml=>create( ).
o_document = o_ixml->create_document( ).
* The o_document have a set of methods to add elements, attributes, etc.
o_element = o_document->create_simple_element(
name = 'RootNode'
value = 'some text'
parent = o_document ).
o_streamfactory = o_ixml->create_stream_factory( ).
o_ostream = o_streamfactory->create_ostream_itable( table = t_xml_table ).
o_renderer = o_ixml->create_renderer( ostream = o_ostream document = o_document ).
o_renderer->render( ).
v_xml_size = o_ostream->get_num_written_raw( ).
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
bin_filesize = v_xml_size
filename = 'C:a.xml'
filetype = 'BIN'
CHANGING
data_tab = t_xml_table. -
Creating an xml file from recordset
Hi...
XML newbie here - so.
Is it possible to create and xml file from a recordset?
I need to create a datafeed of our e-commerce products.
Also, some of the db data contains HTML Code (product
description field),
how will this effect the xml file?
Another problem is that my xml file needs to contain url's
for the products
and product images. My ASP pages contain these URL in hard
code and then
pull the actual file names from the db
Hope that makes some sense
Thanks for any help
AndyHi David
Thanks for your help.
I think it will have to be option 1 as i am using Access DB.
I don't know how to go about it but will serach good old
Google.
Here is my recordset below, that pulls the required data from
Access.
The product and product image URL's need to be in the xml
file but only the
product image name and product id are in the database, e.g
image name
(imagename.jpg) productid (21)
The actual URL's are hardcoded in my ASP pages, e.g <img
src="products/medium/<%=(RSDetails.Fields.Item("Image").Value)%>"
Not sure if this makes things any clearer :-|
Thanks Again
Andy
<%
Dim RSdatafeed
Dim RSdatafeed_numRows
Set RSdatafeed = Server.CreateObject("ADODB.Recordset")
RSdatafeed.ActiveConnection = MM_shoppingcart_STRING
RSdatafeed.Source = "SELECT Products.Product,
Products.Description,
Products.Image, Products.image2, Products.ListPrice,
Products.Price,
Products.xml_feed, Manufacturers.Manufacturer,
Shipping.ShippingCost FROM
Shipping, Products INNER JOIN Manufacturers ON
Products.ManufacturerID =
Manufacturers.ManufacturerID WHERE
(((Products.xml_feed)=No));"
RSdatafeed.CursorType = 0
RSdatafeed.CursorLocation = 2
RSdatafeed.LockType = 1
RSdatafeed.Open()
RSdatafeed_numRows = 0
%>
"DEPearson" <[email protected]> wrote in
message
news:[email protected]...
> Andy,
>
> There are two ways you can create a xml file from a
recordset
>
> 1. Is to code it using Server.CreateObject(XMLDOM)
> 2. If you are using SQL server 2005, just request the RS
returns as XML
> data. using FOR XML AUTO after the where cause ( the
best way with 2005
> and
> higher sql server)
>
> The db data containing HTML code should not effect your
xml file, unless
> it
> is bad markup. You could wrap the data with
<![CDATA[the data or html
> markup, or javascript]]>
>
> If the url is a recordset field, then it will return
with the xml data.
> If
> not you can create a storage procedure that will build
your URL from the
> data
> in the database.
>
> It is best to use storage procedure (SP )for security
reason when pulling
> data
> from a MS Sql server, make all calls to the database in
a SP. Also be sure
> to
> validate the values in the querystrings before accepting
them, check for
> hack
> code.
>
> David
> -
Creating Excel xml spreadsheets from XSL
Hi
I am trying to create Excel xml spreadsheets from XSL.
I am using Tim's blog as my reference.
http://blogs.oracle.com/xmlpublisher/2010/03/multisheet_excel_output.html
Following is my xml data:
<?xml version="1.0" encoding="WINDOWS-1252"?>
<!-- Generated by Oracle Reports version 10.1.2.0.2 -->
<XXTEK_TEST>
<LIST_G_PROCESSED_DATE>
<G_PROCESSED_DATE>
<PROCESSED_DATE>30-MAR-09</PROCESSED_DATE>
<PARTY_NAME>partyname1</PARTY_NAME>
<ORDER_NUMBER>17183</ORDER_NUMBER>
</G_PROCESSED_DATE>
<G_PROCESSED_DATE>
<PROCESSED_DATE>03-APR-09</PROCESSED_DATE>
<PARTY_NAME>partyname2</PARTY_NAME>
<ORDER_NUMBER></ORDER_NUMBER>
</G_PROCESSED_DATE>
<G_PROCESSED_DATE>
<PROCESSED_DATE>03-APR-09</PROCESSED_DATE>
<PARTY_NAME>partyname3</PARTY_NAME>
<ORDER_NUMBER></ORDER_NUMBER>
</G_PROCESSED_DATE>
<G_PROCESSED_DATE>
<PROCESSED_DATE>03-APR-09</PROCESSED_DATE>
<PARTY_NAME>party name5</PARTY_NAME>
<ORDER_NUMBER></ORDER_NUMBER>
</G_PROCESSED_DATE>
<G_PROCESSED_DATE>
<PROCESSED_DATE>30-MAR-09</PROCESSED_DATE>
<PARTY_NAME>partyname7</PARTY_NAME>
<ORDER_NUMBER>17183</ORDER_NUMBER>
</G_PROCESSED_DATE>
</LIST_G_PROCESSED_DATE>
</XXTEK_TEST>
Following is my xsl file:
<xsl:stylesheet version="1.0" xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="urn:my-scripts"
xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
<xsl:output method="xml" encoding="utf-8" indent="yes" omit-xml-declaration="no"/>
<xsl:template match="/">
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<ss:Styles>
<ss:Style ss:ID="Default" ss:Name="Normal">
<ss:Font ss:Color="black" ss:Size="10" ss:Bold="1" ss:FontName="Arial"/>
</ss:Style>
<ss:Style ss:ID="x1">
<ss:Font ss:Color="black" ss:Size="10" ss:FontName="Arial"/>
</ss:Style>
<ss:Style ss:ID="xdo2">
<ss:Font ss:Color="black" ss:Size="10" ss:FontName="Arial"/>
<ss:NumberFormat Format="$#,##0;[Red]$#,##0" Bold="0" />
</ss:Style>
</ss:Styles>
<xsl:apply-templates select="XXTEK_TEST"/>
</Workbook>
</xsl:template>
<xsl:template match="XXTEK_TEST">
<Worksheet>
<Table x:FullColumns="1" x:FullRows="1">
<Row>
<Cell>
<Data ss:Type="String">Process date</Data>
</Cell>
<Cell>
<Data ss:Type="String">Party name</Data>
</Cell>
<Cell>
<Data ss:Type="String">Order number</Data>
</Cell>
</Row>
<xsl:for-each select=".//G_PROCESSED_DATE">
<Row>
<Cell ss:StyleID="x1">
<Data ss:Type="String">
<xsl:value-of select="PROCESSED_DATE"/>
</Data>
</Cell>
<Cell ss:StyleID="x1">
<Data ss:Type="String">
<xsl:value-of select="PARTY_NAME"/>
</Data>
</Cell>
<Cell ss:StyleID="x1">
<Data ss:Type="String">
<xsl:value-of select="ORDER_NUMBER"/>
</Data>
</Cell>
</Row>
</xsl:for-each>
</Table>
</Worksheet>
</xsl:template>
</xsl:stylesheet>
While creating the template, I have chosen the template type XSL-XML. I am trying to test this on E-business Suite (R12).
I get the error "The uploaded file TEST_temp.xsl is invalid. The file should be in XSL format."
Where am I going wrong?
I am trying to create Excel XML spreadsheets, because the excel files created using RTF templates are very huge in size. And it is taking an unacceptable amount of time to open the file. Is there any other solution to overcome this performance issue?
Regards
NishkaNishka,
Looks like your XSL stylesheet is missing the XML header at the top.
So normally it would look like:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet....>
</xsl:stylesheet>
as an Example a stylesheet which just outputs a field:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xdoxslt="http://www.oracle.com/XSL/Transform/java/oracle.apps.xdo.template.rtf.XSLTFunctions">
<xsl:template match="/">
<xsl:text>My field:</xsl:text>
<xsl:value-of select="MYFIELD"/>
</xsl:template>
</xsl:stylesheet>
Patrick -
How to create an XML document from a String.
Can anyone help,
In the Microsoft XML Document DOM there is a load function load(string) which will create an XML document, but now we are switching to Java and I do not know how to create and XML document from a string, this string �xml document� is passed to my program from a webservice and I need to read several xml elements form it in a web server.
This string is a well formatted XML document:
<?xml version="1.0" encoding="UTF-8"?>
<Countries NumberOfRecords="1" LanguageID="en-us">
<Country>
<CountryCode>AU</CountryCode>
<CountryName>AUSTRALIA</CountryName>
</Country>
</Countries>Thanks PC!
I made it work using:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
factory.setIgnoringComments(true); // We want to ignore comments
// Now use the factory to create a DOM parser
DocumentBuilder parser = factory.newDocumentBuilder();
//TransformThisStringBuffer is a string buffer wich contain the 'XML document (String)'
InputStream in = new ByteArrayInputStream(TransformThisStringBuffer.toString().getBytes());
// Parse the InputStream and build the document
Document document = parser.parse(in);
But which one is faster InputSource or InputStream, were would you put the "new InputSource(new StringReader(yourString))" in the above code? -
How to Create an XML document from XSQL servlet which follows a particular DTD struct
how to Create an XML document from XSQL servlet which follows a particular DTD structure.Could anyone send me a sample code for this.
You'll need to associate an XSLT transformation with your XSQL page that transforms the canonical result into your DTD-valid format.
For example, given an XSQL page like:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="rss.xsl" ?>
<xsql:query max-rows="3" connection="demo" xmlns:xsql="urn:oracle-xsql">
select title,id,description,url,to_char(timestamp,'Mon DD') timestamp
from site_entry
order by id desc
</xsql:query>and an "rss.xsl" stylesheet that looks like this:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes" doctype-system="rss-0.91.dtd"/>
<xsl:template match="/">
<xsl:for-each select="ROWSET/ROW">
<rss version="0.91">
<channel>
<title>Do You XML?</title>
<link>http://xml.us.oracle.com</link>
<description>Oracle XML Website Demo</description>
<language>en-us</language>
<xsl:for-each select="ITEM">
<item>
<title><xsl:value-of select="TITLE"/></title>
<link><xsl:value-of select="URL"/></link>
<description><xsl:value-of select="DESCRIPTION"/></description>
</item>
</xsl:for-each>
</channel>
</rss>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>You produce DTD-valid output against the rss-0.91.dtd DTD that looks like:
<?xml version = '1.0' encoding = 'UTF-8'?>
<!DOCTYPE rss SYSTEM "rss-0.91.dtd">
<rss version="0.91">
<channel>
<title>Do You XML?</title>
<link>http://xml.us.oracle.com</link>
<description>Oracle XML Website Demo</description>
<language>en-us</language>
</channel>
</rss>
<rss version="0.91">
<channel>
<title>Do You XML?</title>
<link>http://xml.us.oracle.com</link>
<description>Oracle XML Website Demo</description>
<language>en-us</language>
</channel>
</rss>
<rss version="0.91">
<channel>
<title>Do You XML?</title>
<link>http://xml.us.oracle.com</link>
<description>Oracle XML Website Demo</description>
<language>en-us</language>
</channel>
</rss> -
Hi,
I need to get the tag name of bold applied in InDesign document. When finding bold contents in InDesign document using Find Options, its select bold contents with some hidden text (tags) as shown in the below image. If i use "select in structure" of selected text, its select wrong element (parent of all selected elements). I need to get the correct XML Element of selected text (Except hidden character). How can i get the element of selected text??
Can anyone help me.
- Sudha KHi,
I need to get the tag name of bold applied in InDesign document. When finding bold contents in InDesign document using Find Options, its select bold contents with some hidden text (tags) as shown in the below image. If i use "select in structure" of selected text, its select wrong element (parent of all selected elements). I need to get the correct XML Element of selected text (Except hidden character). How can i get the element of selected text??
Can anyone help me.
- Sudha K -
Creating an xml file from abap code
Hello All,
Please let me know which FM do I need to execute in order to create an XML file from my ABAP code ?
Thanks in advance,
Paul.This has been discussed before
XML files from ABAP programs -
How I can create a XML file from java Aplication
How I can create a XML file from java Aplication
whith have a the following structure
<users>
<user>
<login>anyName</login>
<password>xxxx</password>
</user>
</users>
the password label must be encripted
accept any suggestionLet us assume you have all the data from the jsp form in an java bean object..
Now you want a xml file. This can be acheived in 2 ways
1. Write it into a file using java.io classes. Say you have a class with name
write("<name>"+obj.getName+</name>);
bingo you have a flat file with the xml
2. Use data binding to do the trick
will recommend JiBx and Castor for the 2nd option
Regards,
Rajagopal -
Creating an xml file from a playlist - message for iTunes staff
When I created an xml file from a playlist I noticed that in the xml file the track name was merged with the artist name in this manner "I want you - Bob Dylan".
That was hardly a problem as I could easily correct this in the FileMaker Pro environment.
But subsequently I found out, that within iTunes the track name was similarly changed to the same format. Apparently this happened when iTunes created the xml file and inadvertently also changed the track name within iTunes.
It can easily be corrected by entering File/Info, but I had over 10.000 songs in that list and it will take a lot of time. I have to do this, as I created earlier for each song a file path in FileMaker Pro, which are unrecognizable now.
Could you please correct the xml file creating procedure?I must confess that I can't reproduce this result myself anymore.
I created the xml file in iTunes via File/Library/Export Playlist/xml structure (I translate the Dutch terms loosely) and subsequently I imported the xml file into a Filemaker Pro via File/Import/xml.
The xsl style sheet looks ok.
It looks like a freak of nature.
Still I have the evidence in my iTunes playlist, where I have another 9000 clicks to go to repair the damage.
Let's forget about it, until it happens again.
Thanks for your time. -
Why photoshop CC doesn't let me create a 3D extrusion from selected layer
Check this image and please tell me that why it doesn't let me create a 3D extrusion from selected layer
Hi
Please follow the following link
Photoshop Help | 3D workflow | CC, CS6
or
http://tinyurl.com/7w9hrag
May be it will be helpful
Thanks -
How to create workflow container element from workflow builder?
How to create workflow container element from workflow builder?
in workflow
three are five container, for each container we have define according to requirement of that particular container.
1. event container
2. workflow container
3. task container
4. method container
5. rule container
1. event container
in evernt contianer we have to create elements in BOR where we create event in parameters
2. workflow container
in workflow container we have to create elements in workflow builder itself. in left side of the screen we see <double click to create element>
3. task container
in task container we have to create in task itself it has a tab called container elements
4. method container
in method container we have to create in BOR. it is created in parameter of that BOR.
5. rule container
in rule container we have to create in PFAC transaction -
Create an XML document from a HTML form???
Good morning, is it possible to create an XML document from a HTML form
if yes, can someone tell me how to proceed exactely, I would be very thankful!Hi,
A very simple intro at this link. Apologies for anything unclear.
http://cswww.essex.ac.uk/TechnicalGroup/TechnicalHelp/xmlCreate.htm
best
kev -
Hello
My objective is to have a xml file created from a list for anonymous access. The SharePoint RSS feed is a .aspx file not xml, as shown below:
_layouts/listfeed.aspx?List=21c2cdaa%2D52f3%2D4057%2Db674%2D45e63ba77e31&View=535eb328%2Db5fb%2D45c5%2D8fe8%2Da130e92afc41
Also, is there a way to do this so that the xml content has current data like the list.
Thank you for any insight and direction.Hi,
According to your post, my understanding is that you wanted to create a xml file from a SharePoint list.
To generate a XML file, we can use the SharePoint Object Model or PowerShell to achieve it.
Generate a hierarchical XML file from SharePoint list using Client Object Model.
http://maxderungs.wordpress.com/2012/05/12/generate-a-hierarchical-xml-file-from-sharepoint-list/
Get SharePoint list items and export them to XML using PowerShell
http://www.robertkuzma.com/2012/09/get-sharepoint-list-items-and-export-them-to-xml-using-powershell/
More reference:
http://www.robertkuzma.com/2010/08/how-to-create-a-custom-xml-output-using-sharepoint-services-3-0/
http://traceynolte.com/blog/convert-sharepoint-list-to-xml/
Thanks & Regards,
Jason
Jason Guo
TechNet Community Support -
Generate xml element from Union of 2 Select queries
Do you know ho I can get the union result of 2 queries and put them in xml result, but I want each query to be in seperate xml element.
I don t want to put 1 single xmlelement and do a From then construct a virtual table uniting the 2 subqueries
I mean I don t want something like the following:
(Select
XMLAGG(
XMLELEMENT("credit",
XMLForest(field1 "detail")
FROM
--SubQuery1
Select field1 from myTable1
union
--SubQuery1
Select field1 from myTable2
) "credits"
I want something like here:
XMLELEMENT("credits",
(SELECT
XMLAGG(
XMLELEMENT("credit",
XMLForest(field1 "field1")
FROM
myTable1
(SELECT
XMLAGG(
XMLELEMENT("credit",
XMLForest(field1 "field1")
FROM
myTable2
Except the 2nd alternative is not working Sad
I get error message:
"SQL command not properly ended"
Thanks a lottry
SELECT XMLElement("file",
XMLForest( -- File details
FILETABLE.ID_FILE "fileNumber",
FILETABLE.ID_PRET_CLT "loanID"), -- new
-- Debits are pulled from both myTable1 and myTable2 tables
-- First: fetching debits from myTable1 table
(Select XMLELEMENT("debits",
(SELECT XMLAGG(XMLELEMENT("debit",
XMLELEMENT("referenceNumber",
NUM_REFERENCE)))
FROM myTable1
Where ID_FILE =
FILETABLE.ID_FILE),
-- Second: fetching debits from myTable2 table
(SELECT XMLAGG(XMLELEMENT("debit",
XMLELEMENT("referenceNumber",
NUM_REFERENCE)))
FROM myTable2
Where ID_FILE =
FILETABLE.ID_FILE))
from dual) /*as XXXX)*/) xml
FROM FILETABLE
Maybe you are looking for
-
Outlook 2007 - Automatic processing doesn't work unless logged in
Hi guys, I'm working with an equipment mailbox in an Exchange 2007 / Office 2007 and am having some difficulty getting it to work properly. Basically, I've set the equipment mailbox up appropriately and have checked all three of the 'Resource Schedul
-
How to create Cool animation in java?
Hi i want to create cool animations in java. for example splash screen which appears as that of picasa's splash screen. I need some code so that i can read it and understand and implement in my project. I also want to apply new themes. where can i fi
-
How to print from a kindle fire
How do you print a webpage from a Kindle Fire
-
Joining 2 reports at answers level, is it possible?
Hello I'd like to know whether it's possible to use 2 separate reports as physical data sets to create a new report by joining them? I have report A and Report B, they both have different structure and filters.. I'd like to create a new report using
-
Problems with webcam and microphone on Satellite with Windows 7
Hi, I have installed Windows 7 on my Toshiba Satellite and all of a sudden the webcam and the microphone won't work. I have tried to find the appropiate drivers, but I can't seem to find any. Could anyone please help? best regards Teresa