XML Sorting
A little new to this... but I have gotten my "for each"
repeating field working great, but how do I choose a sort for the
results? I want to sort the results based on one of my XML
variables. i.e. I have a field that is numbered 1-5, and I want it
to sort in reverse order (all the 5's first, etc.)
Thanks - Don
Of course XSLT would be technique of choice if it would be available. The really cool hacker solution of course wouuld be building your own XSLT / XPATH implementation in abap for 4.6- but sometimes the quick and dirty solution is the better choice. In the end if the XML is not to structured / complex it's just a bit hack and slay or SPLIT and CONCATENATE ;o)
DATA:
lv_xml_old TYPE string,
lv_xml_new TYPE string,
ln_beg TYPE i,
ln_end TYPE i,
ln_len TYPE i,
lv_buff TYPE string,
lt_buff TYPE TABLE OF string.
CONCATENATE
'<doc number = ''12343401''>John Smith</doc>'
'<BEHs>'
'<BEH id = ''04''>2000</BEH>'
'<BEH id = ''02''>200</BEH>'
'<BEH id = ''03''>1230</BEH>'
'<BEH id = ''01''>223</BEH>'
'</BEHs>'
'</doc>'
INTO
lv_xml_old.
REPLACE ALL OCCURRENCES OF '''' IN lv_xml_old WITH '"'.
FIND FIRST OCCURRENCE OF '<BEHs>' IN lv_xml_old MATCH OFFSET ln_beg.
FIND FIRST OCCURRENCE OF '</BEHs>' IN lv_xml_old MATCH OFFSET ln_end.
ln_beg = ln_beg + 6.
ln_len = ln_end - ln_beg.
SPLIT lv_xml_old+ln_beg(ln_len) AT '</BEH>' INTO TABLE lt_buff.
SORT lt_buff.
lv_xml_new = lv_xml_old(ln_beg).
LOOP AT lt_buff INTO lv_buff.
CONCATENATE
lv_xml_new
lv_buff
'</BEH>'
INTO
lv_xml_new.
ENDLOOP.
CONCATENATE
lv_xml_new
lv_xml_old+ln_end
INTO
lv_xml_new.
REPLACE ALL OCCURRENCES OF '"' IN lv_xml_new WITH ''''.
WRITE lv_xml_new.
hf
Roman
Similar Messages
-
Abap- XML: sorting of attributes
Hi,
I would like to create an XML-File from ABAP.
This still works fine.
There's only one problem: the sorting of the output-XML-file is not like the sorting at the XSLT.
Here's the part of the coding of the transformation:
<xsl:element name="PERSON">
<xsl:attribute name="Personennr"><xsl:value-of select="PARTNR_--40ADRNR" /></xsl:attribute>
<xsl:attribute name="PersArtCd"><xsl:value-of select="PARTTYPE" /></xsl:attribute>
<xsl:attribute name="LandesCd"><xsl:value-of select="COUNTRY" /></xsl:attribute>
<xsl:attribute name="PLZ"><xsl:value-of select="POSTCODE" /></xsl:attribute>
<xsl:attribute name="Ort"><xsl:value-of select="CITY" /></xsl:attribute>
<xsl:attribute name="Strasse"><xsl:value-of select="STREET_NO" /></xsl:attribute>
The output looks like this:
<PERSON LandesCd="A" Ort="WIEN" PLZ="1010" PersArtCd="X" Personennr="000123456" Strasse="STREET. 1">
I want to have the field "Personennr" at first position and the sorting as in the XSLT respectively.
Any ideas??
Best regards,
WolfgangHi Wolfgang,
I receive attributes in the listed order, unsorted, only with crazy tricks...
<i><u>Either using names with leading spaces:</u></i><pre>
<xsl:attribute name=" Personennr"><xsl:value-of select="PARTNR_--40ADRNR" /></xsl:attribute>
<xsl:attribute name=" PersArtCd"><xsl:value-of select="PARTTYPE" /></xsl:attribute>
<xsl:attribute name=" LandesCd"><xsl:value-of select="COUNTRY" /></xsl:attribute>
<xsl:attribute name=" PLZ"><xsl:value-of select="POSTCODE" /></xsl:attribute>
<xsl:attribute name=" Ort"><xsl:value-of select="CITY" /></xsl:attribute>
<xsl:attribute name="Strasse"><xsl:value-of select="STREET_NO" /></xsl:attribute> </pre>
<u><i>or using different namespaces for each attribute:</i></u><pre>
<xsl:attribute name="Personennr" namespace="1"><xsl:value-of select="PARTNR_--40ADRNR" /></xsl:attribute>
<xsl:attribute name="PersArtCd" namespace="2"><xsl:value-of select="PARTTYPE" /></xsl:attribute>
<xsl:attribute name="LandesCd" namespace="3"><xsl:value-of select="COUNTRY" /></xsl:attribute>
<xsl:attribute name="PLZ" namespace="4"><xsl:value-of select="POSTCODE" /></xsl:attribute>
<xsl:attribute name="Ort" namespace="5"><xsl:value-of select="CITY" /></xsl:attribute>
<xsl:attribute name="Strasse" namespace="6"><xsl:value-of select="STREET_NO" /></xsl:attribute> </pre>
Of course, it contradicts the W3C standards and common sense and the first trick doesn't work with IE or other XSLT processors, except SAP's XSLT_TOOL and CALL TRANSFORMATION...
Best regards,
Vlad -
How would I sort a bunch of XML nodes? I don't necessarily
need to change the existing structure, but I do need to iterate
through in a specific order. In AS2 I would use the childNodes
array and use Array.sort.And here's a attribute sort function from
http://freerpad.blogspot.com/2007/07/more-hierarchical-sorting-e4x-xml-for.html.
var xml:XML =
<root>
<node id="2">alpha</node>
<node id="3">delta</node>
<node id="5">bravo</node>
<node id="0">foxtrot</node>
<node id="1">echo</node>
<node id="4">charlie</node>
</root>
sortXmlAttribute(xml,"id",true, Array.CASEINSENSITIVE);
trace(xml)
function sortXmlAttribute
( avXml :XML,
avAttributeName :String,
avPutEmptiesAtBottom :Boolean,
avArraySortArgument0 :* = 0,
avArraySortArgument1 :* = 0 )
:void
var lvChildrenCount:int
= avXml.children().length();
if( lvChildrenCount == 0 )
return;
if( lvChildrenCount > 1 )
var lvAttributeValue :String;
var lvXml :XML;
var lvSortOptions:int
= avArraySortArgument0 is Function
? avArraySortArgument1 : avArraySortArgument0;
var lvSortCaseInsensitive:Boolean
= ( lvSortOptions & Array.CASEINSENSITIVE )
== Array.CASEINSENSITIVE;
var lvArray:Array = new Array();
for each( lvXml in avXml.children() )
lvAttributeValue
= lvXml.attribute( avAttributeName );
if( lvSortCaseInsensitive )
lvAttributeValue
= lvAttributeValue.toUpperCase();
if( lvArray.indexOf( lvAttributeValue ) == -1 )
lvArray.push( lvAttributeValue );
} // for each
if( lvArray.length > 1 )
lvArray.sort
avArraySortArgument0,
avArraySortArgument1
if( avPutEmptiesAtBottom )
if( lvArray[0] == "" )
lvArray.push( lvArray.shift() );
} // if
} // if
var lvXmlList:XMLList = new XMLList();
for each( lvAttributeValue in lvArray )
for each( lvXml in avXml.children() )
var lvXmlAttributeValue:String
= lvXml.attribute( avAttributeName );
if( lvSortCaseInsensitive )
lvXmlAttributeValue
= lvXmlAttributeValue.toUpperCase();
if( lvXmlAttributeValue == lvAttributeValue )
lvXmlList += lvXml;
} // for each
} // for each
avXml.setChildren( lvXmlList );
} // if
for each( var lvXmlChild:XML in avXml.children() )
sortXmlAttribute
lvXmlChild,
avAttributeName,
avPutEmptiesAtBottom,
avArraySortArgument0,
avArraySortArgument1
} // for each
} // sortXmlAttribute -
How to sort the data in JSP using stylesheet sorting?
Hi, i extracted data out in and display them <%=data%> in the jsp, but how to sort? do i have to provide a drop down list that gives different sorting options, and when user clicks on one option, say sort by title, the collection of results are sorted out on the same jsp page? so all in all, only one jsp page is needed or do i need to create xml files, etc?
i have no idea how to integrate the xml sorting into the jsp page, even after seeing online help, cos there is no example of a jsp page with sorting to refer to. PLease help, thanks alot!im getting the data from beans, but one of the requirements was that i cant use the database to sort and display but i have to use xslt to do the sorting in the jsps, so i have no idea how to do so. possible to give an example? thanks
-
Sort column in advanceddatagrid
Hi, i have an interesting question - how to sort column id
datagrid, like i clicked on a header. I use AdvancedDataGrid and
HierarchialDataYes, it works for HierarchicalCollectionView, but works for
only first level of the tree. Like I sort an XMLListCollection,
comparefunction handles only full elements of the first level. I
need also to sort children nodes of the thee (customer wants).
I have done it for XMLListCollection which is the source of
HierarchialData but it's too many letters =)) and i need sort it
and refresh HierarchialData after every change. Advanced datagrid
makes it automatically by pressing on a header.
Here is the code:
quote:
public static function
sortXMLListCollection(xml:XMLListCollection,dataField:String):XMLListCollection
var sorting:Sort=new Sort();
sorting.fields=[new SortField(dataField)];
xml.sort=sorting;
xml.refresh();
for each(var item:XML in xml)
XMLUtils.sortXMLNode(item,sorting);
return xml;
public static function
sortXMLNode(node:XML,sorting:Sort):XML
var tempXML:XMLListCollection=new XMLListCollection(node.*);
tempXML.sort=sorting;
tempXML.refresh();
XMLUtils.clearNode(node);
XMLUtils.appendXMLListInXML(node,tempXML.copy());
for each(var item:XML in node.*)
XMLUtils.sortXMLNode(item,sorting);
return node;
public static function
appendXMLListInXML(xml:XML,xmlList:XMLList):XML
for each(var appendXML:XML in xmlList)
xml.appendChild(appendXML)
return xml;
public static function clearNode(xml:XML):XML
for(var i:int=new
XMLListCollection(xml.*).length-1;i>=0;i--)
delete xml.*
return xml; -
Hello,
I'm defining some Quick Search queries to be used in Agent Inbox (through SAP Menu>Interaction Center>Administration>Agent Inbox>Define Quick Searches (CRMC_IC_AUI_QUICKS)
There is field for defining 'Special Sort' for search results which can be used to define sort algorithm in addition to default options.
My question is, how can I define sort algorithm? I think it is some xml algorithm but I have no idea how? Does anyone have any examples?
Thanks,Hi John,
Thanks for your response. I saw page 48 in the Inbox FAQ doc. It does talk about method for Custom sort by doesn't say anything about how?
I need more details. Someone mentioned that we can write xml sort queries in Custom sort field but I'm looking for more information on how it can be done.
Thanks, -
Ideas or help needed for a simple, robust pluggable framework
Hi all,
Having written a fairly decent plugin engine, similar in concept to the Eclipse plugin engine, although at a more generic scale, I am looking for any possible ideas for a Java Swing framework that is built around the engine, with the concept of using a framework that is built on mostly plugins. My engine handles, or will soon handle, a number of features to make the engine robust enough, yet still easy enough, to use for just about any purpose.
The engine is pretty simple, although with a bit more work I feel will be overall a pretty robust and powerful plugin engine. Each plugin is made up of one or more "services". A plugin is a .jar file that contains a plugin-conf.xml config file, the classes that implement the Service interface, and any supporting classes. The "plugin" is really the package of one or more services and supporting classes. The engine will handle the ability to work with expanded dir structures as well, so that the build process doesn't have to create .jar files on every build of a plugin. The engine has built in support to load, unload and reload a plugin at runtime. This helps during development by allowing auto-reload of a plugin service without having to restart the app. The engine has the ability to "watch" URLs in a separate thread (still working on this), and at given intervals if a change occurs to any plugin, that plugin is reloaded. This is configurable on a per plugin basis in the config file.
Every plugin .jar file gets its own classloader instance. Because of the nature of a framework that may rely heavily on plugins, it will be very common to have plugin dependencies, where a plugin service may rely on one or more other plugin services. The dependencies are configured in the plugin-conf.xml file, and the engine resolves these when the plugin is loaded, automatically. Once all plugins have been loaded, an "init" call is made that then goes and resolves all plugin service dependencies, setting up the behind the scenes work to make sure any service can use any other service it defines to depend on. Another area is plugin versions. There will no doubt be a time when some sort of application may have legacy plugins, but also have newer plugins. For example, an application built on a "core" set of plugins, may eventually update the core plugins with newer versions. The engine allows the "old" plugins to exist and work while new versions of the same plugins may be loaded and working at the same time. This allows older plugins that depend on the old set of core plugins to work, while newer plugins that depend on the new core plugins may work also. Any plugin may depend on one or more services specified by specific versions, or a range of versions.
Plugin services can define to be created when first loaded, or lazy instantiated. Ideally, an application would opt for lazy instantiation until a plugin is needed. For example, a number of plugins may need to add menu items or buttons that would trigger its service. The plugin does not actually need to be created until the menu or button is clicked on. There is one BIG problem with how this engine works though. Unlike the Eclipse (and other) engines where the config file defines the menu item(s), buttons, etc in an xml sort of language, this engine is built for generic use, and therefore is not specific to menu items or buttons triggering a service instantiation. Therefore, a little "hack" is required. A specific plugin that is created when first loaded will be required to set up all the menu items for specific plugins, then handle the actionPerformed() call to instruct the engine to create the service. The next step would be for the plugin service to add its own handler to the specific menu item it depends on, and remove the "old" handler the startup plugin added to it to handle the initial click. Another thought just struck me though. Because the engine must use an XML parser to load every plugin-conf.xml file, it might be possible to "extend" the parsing routine, where by an extending class could be added to the engine to parse plugin-conf.xml files. First the plugin engines own routine would parse it. Then, the extending class could parse for any extra plugin-conf.xml info, such as menu item settings, and directly set up the menu items and handlers in this manner. I will probably include this ability directly in the engine soon anyway, so that nobody else has to do this, but this is one area I would appreciate some feedback on.
Anyway, so that is the jist of the engine. There is more to it under the hood, but that sums up a good part of it. Now, the pluggable framework, much like what the "shell" of eclipse, forte and so forth offer, is built around my engine to make it very easy to build Swing applications with a pluggable framework underneath. The idea is to package up a startup main class that is configurable, a number of useful plugins that other plugins could depend on, such as an Outlook layout, menuing, toolbars, drag/drop, history, undo/redo, macro record, open/save/search/find/replace dialogs, and so forth. This isn't just for an IDE though. The developer using the framework could deploy the basic app with the plugins of his/her choice, and add to it with his/her own plugins.
Soooo, after this long post, what I am getting at is if anyone would be interested in helping out with ideas, feedback, testing, core framework plugins, and so forth. At this time I am keeping the code closed, but will probably public domain it, open source it, or whatever. The finished framework should make it easy for anyone to quickly build useable applications, and if all goes well, I'd like to set up a site with a location for 3rd party plugins to be uploaded, for download, comments, etc. Being a web developer, I myself will probably work on some plugins for Web Services, web stress testing, and so forth. I have lots of ideas for useable plugins.
On that note, one application I am personally working on for my own use, is a simple yet possibly robust internet suite of apps. I want to incorporate FTP, Email, NewsGroup, and IRC/AOL IM/Yahoo IM/MSN IM/ICQ chat into a single app. Every aspect of it would be plugins. Frankly, I hate outlook, Eudora is alright, but I want to do some things with the email app. I also want a single IM/Chat app that can talk with all protocols (not an easy task, take a look at GAIM). Newsgroups are handy to work with for developers and others of interest, as is FTP. But even more so, being able to have all in one big application framework that allows them to share data between each other, work with one another, and so forth is appealing to me, and being written in Java it could potentially work on many platforms, giving some platforms a possible nice set of internet apps to use. Being able to send an email to a mailing list AND have it posted to specific newsgroups at the same time without having to copy/paste, open up separate applications and so forth has appeal. Directly emailing from any chat or newsgroup link without another app starting up is a little faster as well. Those are just "small" things that could prove to be very kewl in a complete internet app. Adding a web browser, well, I don't think I want to go that route. But if there is already a decent Java built web browser, it shouldn't be too hard to add it as a plugin.
So, if anyone is interested, by all means, drop a post to this thread, let me know of interest, feedback, ideas, point out bad things, and so forth. I appreciate all forms of communication.
Thanks.Yes I do. I am using it now with my work related project.
I am in fact reworking the engine a bit now. I want to incorporate the notion of services (like OSGi) where by a plugin can register services. These services are "global" in scope, meaning any plugin may request the use of a service. However, services, unlike plugins, are not guaranteed to be available. Therefore, plugins using services must be coded to properly handle this possibility. As an example, imagine an email application using my engine. One plugin may provide the email gateway, including the javamail .jar library and provide the email service. Other plugins, such as the one that provides the functionality for the SEND button, would "use" this service. At runtime, when the send button was pressed it would ask the engine for the email service. If available, off goes the email. If not, it could pop up a dialog indicating some sort of message that the email service is not available.
I am at the VERY beginning stages in this direction so I'd love to have ideas, thoughts, suggestions as to how this might be implemented. I do believe though that it will provide for a more powerful engine. The nice thing is, while the engine will support static runtime plugins, it will also support dynamic services that can come and go during the runtime. The key is that plugins using services do not maintain references to them, but instead query the engine each time a plugin needs to use a service.
Static plugins are those that are guaranteed to be available or if not, any dependent plugin is not allowed to load. That is, if A depends on B and B is not able to be loaded, A is unloaded as well as it can't perform its job without B; it depends on B in some manner to complete its function. Imagine a plugin adding an option panel to the Preferences page only that the Preferences plugin is not loaded. It just can't work. However, with some work, there could be variations on this. That is, a plugin may provide a menu item as well as a preferences page. If the preference plugin is not available, then the plugin may simply still work via the menu item, but have no preferences panel available. This should be configurable via the plugin-conf.xml config file. However, as I have it now, using extension points and extensions like Eclipse does, it is also possible that if the Preferences plugin isn't loaded, it wont look for ANY extensions extending its extensino point, and therefore the plugins could all still run but there would simply be no preferences page. So, I am not entirely sure yet which way is best for this to work.
My engine, as it stands now, allows for separate classloader plugin loading, it automatically resolves all dependencies by creating the plugin registry each time the engine is started up. To speed up plugin loading, it maintains a plugins.xml file in the root dir that keeps track of each plugin that was loaded and its last timestamp. Plugins can be open directory files or jarred up into .PAR files (think .WAR or .EAR files). The engine can find .par or open-dir plugins in multiple locations (including URL locations for direct .par files). When it finds a .par file, it first decompresses the .par file to a plugin work directory. Every plugin must have a plugin-conf.xml in its root dir, and either a /classes dir where compiled classes are, or a .jar file in the root path of the plugin, where the /classes dir superscedes the .jar file. Alternatively, anything in a /lib dir is automatically picked up as part of the plugin classpath. So a plugin that wraps the xerces.jar file can simply place the xerces.jar in the /lib dir and automatically present the xerces library to all dependent plugins (which can import the xerces classes but not need to distribute the xerces.jar file if a plugin they depend on has it in its /lib dir). The "parent lookup" process goes only one parent level deep. That is, if plugin A depends on a class in a /lib/*.jar file in plugin B, then the engine will resolve the class (through delegation) of plugin B. But if A depends on B, B depends on C where plugin C's /lib/*.jar file contains a class A is looking to use, this will not work and A will throw a ClassNotFoundException. In other words, the parent lookup only goes as far as the classpath of all dependent plugins, not up the chain of all dependent plugins. Eclipse allows each plugin to "export" various classes, or packages, or entire .jar files and the lookup can go all the way up the chain if need be. I haven't yet found a big reason for supporting this, so I am not too concerned with that at this point. The engine does support reloadable plugins although I have not yet implemented it. Because each plugin information object is stored in a Map keyed on the plugins GUID (found in the plugin-conf.xml file), it is easy enough to load a new plugin (since they get their own classloader) and replace the object at the GUID key and now have a reloaded plugin. The harder part is properly notifying all dependent plugins of the reload and what to do with them. Therefore I have not quite yet implemented this feature although the first step can easily be done, so long as nobody minds the "remnants" of older plugins laying around and possibly not being garbage collected.
All of this works now, and I am using it. I do NOT have a generic UI framework just yet. I am working on that now. Eclipse has a very nice feature in that every plugin.xml file builds up the UI without any plugin code ever being created or ran. I am working on something like that now, although I am focussed more on the aspect of the engine at this point.
Two things keep me going. First, the shear fun of working on this and seeing it succeed, even if a little bit. Second, while I love the idea of Eclipse, OSGi and other engines, so far I have yet to find one that is very easy to write plugins for, is very small, and is "generic" enough for any use. Some may argue JBoss core, at 29K can do this. I don't know if it can. It is built around JMX and I don't know that I agree JMX is the "ultimate" core plugin engine for all types of apps. Not that mine is either, but I'd like to see what I am working on become that if possible. Currently, with an xml parser (www.xmlpull.org) added as part of the code, my engine is about 40K with debug info, maybe about 28K without. I expect it to grow a bit more with services, reloadable/unloadable code, and some other stuff. However, I am thinking it will still be around 50K in size and in my opinion, with an xml read/write parser (very fast one at that), extension/extensino points, services, dependencies, multiple versions of plugins (soon), load/unload/reload capabilities, .par management (unjar into work dir, download .par files from urls, etc) and open directory capabilities, inidividual classloaders, automatic dependency resolution, dynamic dependency resolution and possibly even more, I think what my engine offers (and will offer) is pretty cool in my book.
None the less, there is always room for improvement. One of the things I pride myself on is using as little code and keeping the code neat and easily readable, not to mention as non-archaic as possible, makes for an easily maintainable project.
So, having said all that, YES, the engine can be used as is right now. It does not reload plugins, but you can dynamically load plugins, handle dependency resolution, have a very fast xml read/write parser at your disposal for any plugin, and for the most part easily write plugins. That is all possible now. I should put the engine I have now up on my generic-plugin-engine sourceforge project one of these days, perhaps soon I will do that! While I have no problem handing out the code, I am currently the only committer and I don't have it loaded into CVS at this point. I would like to do so very soon.
So, if you are interested, by all means, let me know and I'll be happy to send you what I have, and love to have more help on the next version of this. -
Ideas for a database for my app
I'm thinking about writing a small app for myself. Basically it will be a type of journal program, with some customizations to suit my needs. Basically, it would be a journal program with some slider bars or drop down boxes to help me categorize the type of journal entry. For example, a "Mood" category or something like that.
I'd like to be able to store various bits of information about the journal entries, such as keywords and categorical information so I can lookup journal entries and maybe plot graphics based on certain information.
I'd rather not go the typical route of using a text file to store the data. I'm thinking of maybe a database backend with the ability to do some queries.
This would be a desktop application.
I'd really appreciate it if someone could throw out some suggestions on how to store this information? If there are any free databases out there which would work, please post them.
Thanks!That would work, except that XML is text, and you already said you'd rather not do that. The question is "Do you need a database"? As you noted, there are some downsides to using a database, such as administration and installation. If you've just got a few bits of information, a text file might be better. A database becomes more useful if you've got a lot of information that's all of the same type, and if you can organize your information so that you can query it. XML sort of allows you to do that too, but you have to read and write the entire file every time you want to change something. (Just like the text file.) So it becomes a problem if you have "large" quantities of data.
-
When does a bean get initialised?
Hi,
I am a bit confused at the moment, and the more I think about it, the more confused I get! Here is the scenario....
Some details - it is a JSF application using JSPs and JSF Components. I am using JDeveloper 1.3.2 and Oracle 10g DB.
I have a page (login.jsp) that calls a method in the LoginBean when the user clicks the Login button. This then goes off to the DB and retrieves the user's data (if he/she exists). If successful, the user is navigated to the welcome page. At this point I wish to display the user's details (EmployeeBean) - which are stored in another table, and so will require a query to the find the user's details based on their user_id (retrieved when logging in).
My question is - when/how can I populate the Employee bean. Do I need to explicitly create the Employee bean (with new EmployeeBean()) or does the faces-config.xml sort this out. How can I 'tell' the application that when the welcome.jsp page is loaded I want/want to have populate(d) the EmployeeBean with the relevent details.
If this requires further info, please tell me and I'll add to it!
Thank you.Hi,
You can use a session bean (the LoginBean or an other) that retrieves an EmployeeBean entity bean from the database if the id is given. You should call this method from the welcome page and display the data of the retrieved entity bean.
Regards,
Kati -
[Ann] HTML/CHM for CS6 Javascript
I don't think I've ever been so fast before:
http://www.jongware.com/idjshelp.html is updated, it now also contains my Friendly Help for CS6, as both HTML (separate files) and CHM (one compiled file for use with a Windows Help viewer).
By way of experiment I added a "Full Index" to the HTML version. This is a single huge file, 2.7MB, but it contains links to all properties and methods in the entire set of files. So if you can't use the live one in the compiled CHM, you can still use this one to get a good overview of What to find Where.
... Enjoy!Maybe I'll be enthused to try this before my idea of when Jongware wakes up :-)
Right. So, here's some XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text"/>
<xsl:template match="text()|@*"/> <!-- Suppress default text output -->
<xsl:template match="property|method">
<xsl:call-template name="list-name-and-grandparent-name-with-tabs"/>
</xsl:template>
<xsl:template name="list-name-and-grandparent-name-with-tabs">
<xsl:value-of select="name()"/>
<xsl:if test="../../@enumeration">(enum)</xsl:if>
<xsl:text>	</xsl:text>
<xsl:value-of select="name()"/><xsl:text>	</xsl:text>
<xsl:value-of select="../../@name"/><xsl:text>	</xsl:text>
<xsl:value-of select="@name"/><xsl:text>	</xsl:text>
<xsl:text> </xsl:text>
</xsl:template>
</xsl:stylesheet>
Hopefully it's self-explanatory. I even added the "(enum)" to distinguish enums from regular properties. Just for you, Peter K!
Then we just run it on the omv cachefiles, sort the output, and do some comparisons with "comm."
That is:
xsltproc omv.xsl omv\$indesign-7.5\$7.5.xml | sort > 7575.txt
xsltproc omv.xsl omv\$indesign-8.0\$8.0.xml | sort > 8080.txt
I hope it's not a dumb idea to put this all in one long post...
For instance, the following 29 items were removed from CS5.5 to CS6 (comm -23 7575.txt 8080.txt):
property
Button
visibilityInPdf
property
DocumentPreference
masterTextFrame
property
DocumentPreset
masterTextFrame
property
EPubExportPreference
cssExportOption
property
EPubExportPreference
externalCSSPath
property
EPubExportPreference
format
property
EPubExportPreference
marginUnit
property
EPubExportPreference
spaceUnit
property
EPubExportPreference
useTocStyle
property
HTMLExportPreference
bottomMargin
property
HTMLExportPreference
externalCSSPath
property
HTMLExportPreference
javascriptURL
property
HTMLExportPreference
leftMargin
property
HTMLExportPreference
linkToJavascript
property
HTMLExportPreference
marginUnit
property
HTMLExportPreference
rightMargin
property
HTMLExportPreference
spaceUnit
property
HTMLExportPreference
topMargin
property
ObjectExportOption
customImageAlignment
property
ObjectExportOption
spaceUnit
property
PagesPanel
verticalView
property(enum)
SpaceUnitType
CSS_EM
property(enum)
SpaceUnitType
CSS_PIXEL
property(enum)
StyleSheetExportOption
EXTERNAL_CSS
property(enum)
StyleSheetExportOption
STYLE_NAME_ONLY
property(enum)
VisibilityInPdf
HIDDEN_BUT_PRINTABLE_IN_PDF
property(enum)
VisibilityInPdf
HIDDEN_IN_PDF
property(enum)
VisibilityInPdf
VISIBLE_BUT_DOES_NOT_PRINT_IN_PDF
property(enum)
VisibilityInPdf
VISIBLE_IN_PDF
And the following 1,984 were added in CS6 (comm -13 7575.txt 8080.txt):
method
Button
contentPlace
method
CellStyleMapping
addEventListener
method
CellStyleMapping
getElements
method
CellStyleMapping
remove
method
CellStyleMapping
removeEventListener
method
CellStyleMapping
toSource
method
CellStyleMapping
toSpecifier
method
CellStyleMappings
method
CellStyleMappings
add
method
CellStyleMappings
anyItem
method
CellStyleMappings
count
method
CellStyleMappings
everyItem
method
CellStyleMappings
firstItem
method
CellStyleMappings
item
method
CellStyleMappings
itemByRange
method
CellStyleMappings
lastItem
method
CellStyleMappings
middleItem
method
CellStyleMappings
nextItem
method
CellStyleMappings
previousItem
method
CellStyleMappings
toSource
method
CharStyleMapping
addEventListener
method
CharStyleMapping
getElements
method
CharStyleMapping
remove
method
CharStyleMapping
removeEventListener
method
CharStyleMapping
toSource
method
CharStyleMapping
toSpecifier
method
CharStyleMappings
method
CharStyleMappings
add
method
CharStyleMappings
anyItem
method
CharStyleMappings
count
method
CharStyleMappings
everyItem
method
CharStyleMappings
firstItem
method
CharStyleMappings
item
method
CharStyleMappings
itemByRange
method
CharStyleMappings
lastItem
method
CharStyleMappings
middleItem
method
CharStyleMappings
nextItem
method
CharStyleMappings
previousItem
method
CharStyleMappings
toSource
method
CheckBox
addEventListener
method
CheckBox
applyObjectStyle
method
CheckBox
asynchronousExportFile
method
CheckBox
autoTag
method
CheckBox
bringForward
method
CheckBox
bringToFront
method
CheckBox
changeObject
method
CheckBox
clearObjectStyleOverrides
method
CheckBox
clearTransformations
method
CheckBox
contentPlace
method
CheckBox
convertShape
method
CheckBox
convertToObject
method
CheckBox
detach
method
CheckBox
duplicate
method
CheckBox
exportFile
method
CheckBox
extractLabel
method
CheckBox
findObject
method
CheckBox
fit
method
CheckBox
flipItem
method
CheckBox
getElements
method
CheckBox
insertLabel
method
CheckBox
markup
method
CheckBox
move
method
CheckBox
override
method
CheckBox
placeXML
method
CheckBox
redefineScaling
method
CheckBox
reframe
method
CheckBox
remove
method
CheckBox
removeEventListener
method
CheckBox
removeOverride
method
CheckBox
resize
method
CheckBox
resolve
method
CheckBox
select
method
CheckBox
sendBackward
method
CheckBox
sendToBack
method
CheckBox
store
method
CheckBox
toSource
method
CheckBox
toSpecifier
method
CheckBox
transform
method
CheckBox
transformAgain
method
CheckBox
transformAgainIndividually
method
CheckBox
transformSequenceAgain
method
CheckBox
transformSequenceAgainIndividually
method
CheckBox
transformValuesOf
method
CheckBoxes
method
CheckBoxes
add
method
CheckBoxes
anyItem
method
CheckBoxes
count
method
CheckBoxes
everyItem
method
CheckBoxes
firstItem
method
CheckBoxes
item
method
CheckBoxes
itemByID
method
CheckBoxes
itemByName
method
CheckBoxes
itemByRange
method
CheckBoxes
lastItem
method
CheckBoxes
middleItem
method
CheckBoxes
nextItem
method
CheckBoxes
previousItem
method
CheckBoxes
toSource
method
ClearFormBehavior
addEventListener
method
ClearFormBehavior
extractLabel
method
ClearFormBehavior
getElements
method
ClearFormBehavior
insertLabel
method
ClearFormBehavior
remove
method
ClearFormBehavior
removeEventListener
method
ClearFormBehavior
toSource
method
ClearFormBehavior
toSpecifier
method
ClearFormBehaviors
method
ClearFormBehaviors
add
method
ClearFormBehaviors
anyItem
method
ClearFormBehaviors
count
method
ClearFormBehaviors
everyItem
method
ClearFormBehaviors
firstItem
method
ClearFormBehaviors
item
method
ClearFormBehaviors
itemByID
method
ClearFormBehaviors
itemByName
method
ClearFormBehaviors
itemByRange
method
ClearFormBehaviors
lastItem
method
ClearFormBehaviors
middleItem
method
ClearFormBehaviors
nextItem
method
ClearFormBehaviors
previousItem
method
ClearFormBehaviors
toSource
method
ComboBox
addEventListener
method
ComboBox
applyObjectStyle
method
ComboBox
asynchronousExportFile
method
ComboBox
autoTag
method
ComboBox
bringForward
method
ComboBox
bringToFront
method
ComboBox
changeObject
method
ComboBox
clearObjectStyleOverrides
method
ComboBox
clearTransformations
method
ComboBox
contentPlace
method
ComboBox
convertShape
method
ComboBox
convertToObject
method
ComboBox
detach
method
ComboBox
duplicate
method
ComboBox
exportFile
method
ComboBox
extractLabel
method
ComboBox
findObject
method
ComboBox
fit
method
ComboBox
flipItem
method
ComboBox
getElements
method
ComboBox
insertLabel
method
ComboBox
markup
method
ComboBox
move
method
ComboBox
override
method
ComboBox
placeXML
method
ComboBox
redefineScaling
method
ComboBox
reframe
method
ComboBox
remove
method
ComboBox
removeEventListener
method
ComboBox
removeOverride
method
ComboBox
resize
method
ComboBox
resolve
method
ComboBox
select
method
ComboBox
sendBackward
method
ComboBox
sendToBack
method
ComboBox
store
method
ComboBox
toSource
method
ComboBox
toSpecifier
method
ComboBox
transform
method
ComboBox
transformAgain
method
ComboBox
transformAgainIndividually
method
ComboBox
transformSequenceAgain
method
ComboBox
transformSequenceAgainIndividually
method
ComboBox
transformValuesOf
method
ComboBoxes
method
ComboBoxes
add
method
ComboBoxes
anyItem
method
ComboBoxes
count
method
ComboBoxes
everyItem
method
ComboBoxes
firstItem
method
ComboBoxes
item
method
ComboBoxes
itemByID
method
ComboBoxes
itemByName
method
ComboBoxes
itemByRange
method
ComboBoxes
lastItem
method
ComboBoxes
middleItem
method
ComboBoxes
nextItem
method
ComboBoxes
previousItem
method
ComboBoxes
toSource
method
ContentPlacerObject
addEventListener
method
ContentPlacerObject
getElements
method
ContentPlacerObject
load
method
ContentPlacerObject
removeEventListener
method
ContentPlacerObject
toSource
method
ContentPlacerObject
toSpecifier
method
Document
createAlternateLayout
method
Document
deleteAlternateLayout
method
EPS
contentPlace
method
EPSText
contentPlace
method
FontLockingPreference
addEventListener
method
FontLockingPreference
getElements
method
FontLockingPreference
removeEventListener
method
FontLockingPreference
toSource
method
FontLockingPreference
toSpecifier
method
FormField
contentPlace
method
Graphic
contentPlace
method
GraphicLine
contentPlace
method
Group
contentPlace
method
Guide
resolve
method
Guide
transformValuesOf
method
HtmlItem
addEventListener
method
HtmlItem
applyObjectStyle
method
HtmlItem
asynchronousExportFile
method
HtmlItem
autoTag
method
HtmlItem
changeObject
method
HtmlItem
clearObjectStyleOverrides
method
HtmlItem
clearTransformations
method
HtmlItem
contentPlace
method
HtmlItem
convertShape
method
HtmlItem
detach
method
HtmlItem
duplicate
method
HtmlItem
exportFile
method
HtmlItem
extractLabel
method
HtmlItem
findObject
method
HtmlItem
fit
method
HtmlItem
flipItem
method
HtmlItem
getElements
method
HtmlItem
insertLabel
method
HtmlItem
markup
method
HtmlItem
move
method
HtmlItem
override
method
HtmlItem
place
method
HtmlItem
placeXML
method
HtmlItem
redefineScaling
method
HtmlItem
reframe
method
HtmlItem
remove
method
HtmlItem
removeEventListener
method
HtmlItem
removeOverride
method
HtmlItem
resize
method
HtmlItem
resolve
method
HtmlItem
select
method
HtmlItem
store
method
HtmlItem
toSource
method
HtmlItem
toSpecifier
method
HtmlItem
transform
method
HtmlItem
transformAgain
method
HtmlItem
transformAgainIndividually
method
HtmlItem
transformSequenceAgain
method
HtmlItem
transformSequenceAgainIndividually
method
HtmlItem
transformValuesOf
method
HtmlItems
method
HtmlItems
add
method
HtmlItems
anyItem
method
HtmlItems
count
method
HtmlItems
everyItem
method
HtmlItems
firstItem
method
HtmlItems
item
method
HtmlItems
itemByID
method
HtmlItems
itemByName
method
HtmlItems
itemByRange
method
HtmlItems
lastItem
method
HtmlItems
middleItem
method
HtmlItems
nextItem
method
HtmlItems
previousItem
method
HtmlItems
toSource
method
Image
contentPlace
method
ImportedPage
contentPlace
method
Link
goToSource
method
LinkedPageItemOption
addEventListener
method
LinkedPageItemOption
getElements
method
LinkedPageItemOption
removeEventListener
method
LinkedPageItemOption
toSource
method
LinkedPageItemOption
toSpecifier
method
ListBox
addEventListener
method
ListBox
applyObjectStyle
method
ListBox
asynchronousExportFile
method
ListBox
autoTag
method
ListBox
bringForward
method
ListBox
bringToFront
method
ListBox
changeObject
method
ListBox
clearObjectStyleOverrides
method
ListBox
clearTransformations
method
ListBox
contentPlace
method
ListBox
convertShape
method
ListBox
convertToObject
method
ListBox
detach
method
ListBox
duplicate
method
ListBox
exportFile
method
ListBox
extractLabel
method
ListBox
findObject
method
ListBox
fit
method
ListBox
flipItem
method
ListBox
getElements
method
ListBox
insertLabel
method
ListBox
markup
method
ListBox
move
method
ListBox
override
method
ListBox
placeXML
method
ListBox
redefineScaling
method
ListBox
reframe
method
ListBox
remove
method
ListBox
removeEventListener
method
ListBox
removeOverride
method
ListBox
resize
method
ListBox
resolve
method
ListBox
select
method
ListBox
sendBackward
method
ListBox
sendToBack
method
ListBox
store
method
ListBox
toSource
method
ListBox
toSpecifier
method
ListBox
transform
method
ListBox
transformAgain
method
ListBox
transformAgainIndividually
method
ListBox
transformSequenceAgain
method
ListBox
transformSequenceAgainIndividually
method
ListBox
transformValuesOf
method
ListBoxes
method
ListBoxes
add
method
ListBoxes
anyItem
method
ListBoxes
count
method
ListBoxes
everyItem
method
ListBoxes
firstItem
method
ListBoxes
item
method
ListBoxes
itemByID
method
ListBoxes
itemByName
method
ListBoxes
itemByRange
method
ListBoxes
lastItem
method
ListBoxes
middleItem
method
ListBoxes
nextItem
method
ListBoxes
previousItem
method
ListBoxes
toSource
method
MasterSpread
contentPlace
method
MediaItem
contentPlace
method
Movie
contentPlace
method
MultiStateObject
contentPlace
method
Oval
contentPlace
method
PDF
contentPlace
method
PICT
contentPlace
method
PNGExportPreference
addEventListener
method
PNGExportPreference
getElements
method
PNGExportPreference
removeEventListener
method
PNGExportPreference
toSource
method
PNGExportPreference
toSpecifier
method
Page
contentPlace
method
Page
deleteAllLayoutSnapshots
method
Page
deleteLayoutSnapshot
method
Page
snapshotCurrentLayout
method
PageItem
contentPlace
method
ParaStyleMapping
addEventListener
method
ParaStyleMapping
getElements
method
ParaStyleMapping
remove
method
ParaStyleMapping
removeEventListener
method
ParaStyleMapping
toSource
method
ParaStyleMapping
toSpecifier
method
ParaStyleMappings
method
ParaStyleMappings
add
method
ParaStyleMappings
anyItem
method
ParaStyleMappings
count
method
ParaStyleMappings
everyItem
method
ParaStyleMappings
firstItem
method
ParaStyleMappings
item
method
ParaStyleMappings
itemByRange
method
ParaStyleMappings
lastItem
method
ParaStyleMappings
middleItem
method
ParaStyleMappings
nextItem
method
ParaStyleMappings
previousItem
method
ParaStyleMappings
toSource
method
Polygon
contentPlace
method
PrintFormBehavior
addEventListener
method
PrintFormBehavior
extractLabel
method
PrintFormBehavior
getElements
method
PrintFormBehavior
insertLabel
method
PrintFormBehavior
remove
method
PrintFormBehavior
removeEventListener
method
PrintFormBehavior
toSource
method
PrintFormBehavior
toSpecifier
method
PrintFormBehaviors
method
PrintFormBehaviors
add
method
PrintFormBehaviors
anyItem
method
PrintFormBehaviors
count
method
PrintFormBehaviors
everyItem
method
PrintFormBehaviors
firstItem
method
PrintFormBehaviors
item
method
PrintFormBehaviors
itemByID
method
PrintFormBehaviors
itemByName
method
PrintFormBehaviors
itemByRange
method
PrintFormBehaviors
lastItem
method
PrintFormBehaviors
middleItem
method
PrintFormBehaviors
nextItem
method
PrintFormBehaviors
previousItem
method
PrintFormBehaviors
toSource
method
RadioButton
addEventListener
method
RadioButton
applyObjectStyle
method
RadioButton
asynchronousExportFile
method
RadioButton
autoTag
method
RadioButton
bringForward
method
RadioButton
bringToFront
method
RadioButton
changeObject
method
RadioButton
clearObjectStyleOverrides
method
RadioButton
clearTransformations
method
RadioButton
contentPlace
method
RadioButton
convertShape
method
RadioButton
convertToObject
method
RadioButton
detach
method
RadioButton
duplicate
method
RadioButton
exportFile
method
RadioButton
extractLabel
method
RadioButton
findObject
method
RadioButton
fit
method
RadioButton
flipItem
method
RadioButton
getElements
method
RadioButton
insertLabel
method
RadioButton
markup
method
RadioButton
move
method
RadioButton
override
method
RadioButton
placeXML
method
RadioButton
redefineScaling
method
RadioButton
reframe
method
RadioButton
remove
method
RadioButton
removeEventListener
method
RadioButton
removeOverride
method
RadioButton
resize
method
RadioButton
resolve
method
RadioButton
select
method
RadioButton
sendBackward
method
RadioButton
sendToBack
method
RadioButton
store
method
RadioButton
toSource
method
RadioButton
toSpecifier
method
RadioButton
transform
method
RadioButton
transformAgain
method
RadioButton
transformAgainIndividually
method
RadioButton
transformSequenceAgain
method
RadioButton
transformSequenceAgainIndividually
method
RadioButton
transformValuesOf
method
RadioButtons
method
RadioButtons
add
method
RadioButtons
anyItem
method
RadioButtons
count
method
RadioButtons
everyItem
method
RadioButtons
firstItem
method
RadioButtons
item
method
RadioButtons
itemByID
method
RadioButtons
itemByName
method
RadioButtons
itemByRange
method
RadioButtons
lastItem
method
RadioButtons
middleItem
method
RadioButtons
nextItem
method
RadioButtons
previousItem
method
RadioButtons
toSource
method
Rectangle
contentPlace
method
SignatureField
addEventListener
method
SignatureField
applyObjectStyle
method
SignatureField
asynchronousExportFile
method
SignatureField
autoTag
method
SignatureField
bringForward
method
SignatureField
bringToFront
method
SignatureField
changeObject
method
SignatureField
clearObjectStyleOverrides
method
SignatureField
clearTransformations
method
SignatureField
contentPlace
method
SignatureField
convertShape
method
SignatureField
convertToObject
method
SignatureField
detach
method
SignatureField
duplicate
method
SignatureField
exportFile
method
SignatureField
extractLabel
method
SignatureField
findObject
method
SignatureField
fit
method
SignatureField
flipItem
method
SignatureField
getElements
method
SignatureField
insertLabel
method
SignatureField
markup
method
SignatureField
move
method
SignatureField
override
method
SignatureField
placeXML
method
SignatureField
redefineScaling
method
SignatureField
reframe
method
SignatureField
remove
method
SignatureField
removeEventListener
method
SignatureField
removeOverride
method
SignatureField
resize
method
SignatureField
resolve
method
SignatureField
select
method
SignatureField
sendBackward
method
SignatureField
sendToBack
method
SignatureField
store -
Sorting Problem in XML Publisher Report
Dear Members,
I am facing problems with sorting data in my XML Publisher Report.
We are using Oracle E-Business Suite 12.1 Version and i developed a rtf Template and executable is an RDF which generates XML Data.
I want the whole report to group by element ITEM_NAME which is a character in the ascending order. I tried several ways but it is not working properly.
I don't know how to upload the RTF template in this forum. I tried to post the XML Code and since its excceds 30000 characters i cant post it in the forum.
Any help is greatly appreciated.
Thanks
SandeepYou can't upload the template here; you can post a part of the relevant XML code and template code here.
or send me a sample XML and RTF template to [email protected] and I will take a look. -
How to sort Data in XML template (rtf) file?
Hi, I have an oracle 11i custom report (rdf) with an xml output to a PDF. There is a formula column in the report. Now I need the data to be sorted on this formula column. As we cannot sort on formula column, i have decided to find a way to sort it in the data in the XML template. But I don't really know how to sort and also where to specify the sort tag in the rtf file. I appreciate your response.
Databse version : 9.2.0.8.0
E-Biz Version : 11.5.10.2
Oracle Reports Version : 6.0.8.27.0
Oracle BI version : 10.1.3.2.1
Note : I posted this question under : XML General forum also. But did not get any response. I assumed that may be thats not the right place to post it as my report is in e-Biz environment.Hi
As long as you don't have your ^field commands grouped inside a ^group the order in the .dat file is not important. Your last command
^field BG_DOC_LN__LN_AM
246624.12
should populate field BG_DOC_LN_AM wherever you place it on your form. Obviously you need to name the fields according to your ^field commands and not just use tab (move to next field).
Shout if this was not what you are asking.
Stale Sodal -
XML Dataset - Sorting non english characters
I've been playing with spry on a production site for more
than a year now. It's turned out to be a great solution in many
situations in spite of being a beta release.
I've found an issue concerning the sorting of text data (in
this case, coming from an XML file). You can find the example page
here:
http://mi.esan.edu.pe/elecciones/2008/electores/.
It's in Spanish but i guess you won't need a translation to
understand what's going on; besides you can always check the source
code if so you wish.
Works fine, though I still have some polishing to do. The
most important part of which is fixing the sort order that spry
gives me by default.
If you click on the "go to last page link" (»), located
below the table/dataset area, you will see that after letter Z come
the words, in this case last names, starting with letter A, but
with a tilde on them. I've devised a workaround, but that requires
creating an extra column with everything converted to only English
characters. My list is already 4000 records long and takes a few
seconds to load. It's definitely going to get much longer in the
years to come and I wish I will be able to give my users the
ability to sort by any column they wish. So, I can't just be adding
columns and duplicating data all around.
Is there a way to tell spry that Á should be sorted as
if it was A (not after A, not before it, and definitely not at the
end of the list), that Ñ should come right after N, and so on?
I will very much appreciate your answer.
Regards,
JoseThank you very much for your reply, Kin.
Sad thing that there wasn't a solution, though.
But, then I guess you must be aware that spry is being used
and will be used by a huge ammount of non English speaking clients
of Adobe. Namely those of us that have Spanish, French, German,
Japanese, Chinese or any other as their primary language. And all
of us would greatly appreciate a not so English-centered solution,
for such a commonplace feature as sorting is.
Given this situation, what chances do you think there are
that Adobe will be developping the necessary language specific
plugins for spry's sorting capabilities? And, how soon would that
be?
In the meantime, I will start trying to do it myself. It
would be fantastic if you coukd give me any hints on how to start,
javascript is not my strongest point but I think I can crack it out
and have a little fun while I'm at it, too.
Regards,
Jose -
How to use XmlModify to sort the XML Data?
Hello,
I saw some examples explain how to use XmlModify in BDB XML package. I want to sort the XML data by several elements but my Java program could not work correctly.
<CustomerData>
<Transaction>
<DLSFIELDS>
<ADR_PST_CD>12345</ADR_PST_CD>
<CLT_IRD_NBR>002</CLT_IRD_NBR>
</DLSFIELDS>
</Transaction>
<Transaction>
<DLSFIELDS>
<ADR_PST_CD>12345</ADR_PST_CD>
<CLT_IRD_NBR>102</CLT_IRD_NBR>
</DLSFIELDS>
</Transaction>
// many nodes like transaction ...
</CustomerData>
My XQuery script was executed successfully in the shell. The script looks as follows:
"for $i in collection('sample.dbxml')/CustomerData/Transaction order by xs:decimal($i//ADR_PST_CD), xs:decimal($i//CLT_IRD_NBR) return $i".
The Java code :
// create XmlManager
XmlManager manager = // ...;
// open XmlContainer
XmlContainer container = // ...;
XmlQueryContext context = manager.createQueryContext(XmlQueryContext.LiveValues, XmlQueryContext.Eager);
XmlQueryExpression expression = manager.prepare("for $i in collection('sample.dbxml')/CustomerData/Transaction order by xs:decimal($i//ADR_PST_CD),xs:decimal($i//CLT_IRD_NBR) return $i", context);
XmlModify modify = manager.createModify();
XmlUpdateContext uc = manager.createUpdateContext();
XmlDocument xmldoc = container.getDocument("sample.xml");
XmlValue value = new XmlValue(xmldoc);
long numMod = modify.execute(value, context, uc);
System.out.println("Peformed " + numMod + " modification operations");
Could you point out the errors above or offer some suggestion?
Thanks.I have other question of the sorting issue. Here are a large XML need to sort so I have to split it to multiple small XML files. After importing these files, I will use the XmlModify and XQuery to sort them. I'm not clear on the multiple XML files processing.
1. Can the BDB XML ensure that all these XML files were sorted or how to update all documents with same logic.
2. If I want export all these sorted documents, how can I ensure these files processed in sequence? Which document needs process first?
The export method:
public void export(String outputfile)throws Exception{
final int BLOCK_SIZE = 5 * 1024 * 1024; // 5Mb
try{
File theFile = new File(outputfile);
FileOutputStream fos = new FileOutputStream(theFile);
byte[] buff= new byte[BLOCK_SIZE];
XmlResults rs = container.getAllDocuments(new XmlDocumentConfig());
while(rs.hasNext()){
XmlDocument xmlDoc = rs.next().asDocument();
XmlInputStream inputStream = xmlDoc.getContentAsXmlInputStream();
long read=0;
while(true){
read = inputStream.readBytes(buff, BLOCK_SIZE);
fos.write(buff,0,(int)read);
if(read < BLOCK_SIZE) break;
inputStream.delete();
xmlDoc.delete();
rs.delete();
//MUST CLOSE!
fos.close();
catch(Exception e){
System.err.println("Error exporting file from container " + container);
System.err.println(" Message: " + e.getMessage());
Thanks. -
URGENT:Sorting in XML Publisher
Hi,
i am trying to get the section data into a variable using the below.
<?variable@incontect:hg;xdoxslt:distinct_values(/SAS_DATA/LIST_WEEKLY/WEEKLY/TYPE)?> , can i do something here so that i get the TYPE values in the SORT ascending.below is the sample data.
<SAS_DATA>
<LIST_WEEKLY>
<WEEKLY>
<BUS_GRP>FBC</BUS_GRP>
<BUS_GRP_SO>1</BUS_GRP_SO>
<MNGD_FLAG>Fidelity Managed</MNGD_FLAG>
<DISC_DSC>Long-Term</DISC_DSC>
<TYPE>Bond</TYPE>
<SORT_ORDER>2</SORT_ORDER>
<FLOWS>44.83</FLOWS>
</WEEKLY>
</LIST_WEEKLY>
</SAS_DATA>
Thanks in advanceYou can't upload the template here; you can post a part of the relevant XML code and template code here.
or send me a sample XML and RTF template to [email protected] and I will take a look.
Maybe you are looking for
-
NF-e issue: NF-e document 8 is not defined
Hello SAP Folks, I received an error in 2 diferent NF-e, they are stucked, and I'm not sure how to fix it, in GRC system they show an error (ERP Error 105) and if I try to update it i got the message described in the subject (NF-e document 8 is not d
-
How to call WD ABAP screens in CE 7.3 Java webdynpro
Hi, I have few developed applications in WD ABAP and I want use the same screen in Java WD using CE7.3 as a part of one iview in a page. Which means I have one page which has 5 views and I would like to use one view - WD ABAP screen. How it is possi
-
IPhoto migration from iPhoto 6 to 9 problem
I am upgrading from an old iMac running Tiger to a new Mac currently running Maverick. I went to transfer over a large photo collection in iPhoto. My previous version of iPhoto was 6.0.6. The new version is 9.5.1. Since my old mac was too old for
-
Is there a way to have a JTextArea select all the text currently typed inside it and have it change the font size? I've tried <JTextArea>.setFont(new Font("Serif", Font.PLAIN, 16) and that doesn't seem to work. Any ideas? I'm certain it's either a ve
-
SCOM services password required to retype everytime restart the services
Hi, Everytime i restart the server center configuration service and system center data access service. It will failed to restart and prompt out password error message. I need to retype the same password and hit Apply then it will prompted with a dial