XML and encoding
I'm being considered for a video encoding position that I would very much like to get.
It is for a TV network. I've used Compressor, Sorenson Squeeze and MPEG Streamclip mostly. Do you know what I should be prepared to encounter at a major network?
Also, they mentioned using XML. How is XML used for encoding video?
Any help is greatly appreciated.
I guess this might not be a good place to post this since it doesn't relate to a specific Apple product. S, apologies if that's the case. I have gotten some good help here before, so I thought I'd try.
Similar Messages
-
How to set buildID.xml and custom.properties in SDK
Hello,
I just completed a new build deployment of SAP ME5.2, because after I deployed the new version, I don't think I have set a
correct version number.Can you someone give me a sample how to set the buildID.xml and custom.properties? I am a new on the SAP ME5.2
The Base version is ME_Base_5.2.5.16.5_netweaver-71_Update.zip and
MEClient_Base_5.2.5.16.5_netweaver-71_Update.zip. the HB customzation
version is ME_xxxxxx_2.0.0.0.x_netweaver-71.
Within the sap note 1484551, you mentioned we need change the
SDKInstallDir/build/buildID.xml file, here is the context of the file:
buildID.xml -
<?xml version="1.0" encoding="UTF-8"?>
<buildID xmlns:xs="http://www.w3.org/2001/XMLSchema">
<customer>XXXXXX</customer>
<revision>1.0.0.0</revision>
<build>1</build>
</buildID>
buildID.xml -
1. how can we change the revision and build?
There is another file BuildToolDir/build/script/custom.properties, here
is the file context:
custom.properties----
This file contains build properties used to configure the build
system.
The name of the software vendor implementing the customizations.
vendor.name=xxxxxxxxx
Vendor build identifier. This value is used to uniquely identify
customizations built by a particular vendor for a particular customer
and base
application version.
This is also used in path locations and in naming certain build
artifacts, like the custom EJB module and the utility classes archive.
vendor.id=xxxxxxxxx
The installation of the J2EE engine installed in the development
environment.
ex. C:/usr/sap/CE1\J00
j2ee.instance.dir=J2EEInstanceDir
The web context path used to access the main web application. This
is used by the build to set the
context-root value in application.xml after an update has been
imported.
web.context.path=
The web context path used to access the production XML interface web
application. This is used by the build to set the
context-root value in application.xml after an update has been
imported.
xml.context.path=
The web context path to access resources from the web extension
application, like images and work instruction HTML files.
web-ext.context.path=web-ext
The target database vendor. Valid values are 'oracle' or 'sqlserver'.db.vendor=ORACLE
The JDBC driver configured for the application server.
db.drivername=VMJDBC
JDBC connection propertes for the WIP (Work In Process) database.
This is the primary application database.
db.wip.driverclassname=
db.wip.driver.url=
db.wip.host=
db.wip.port=
db.wip.sid=
db.wip.user=
db.wip.password=
JDBC connection propertes for the ODS (Open Data Store) database.
This is the offline reporting and archiving database.
db.ods.driverclassname=
db.ods.driver.url=
db.ods.host=
db.ods.port=
db.ods.sid=
db.ods.user=
db.ods.password=
Flag indicating whether to add DPMO NC codes to NC idat files when a
new update is imported. This value is initially
set by the installer according the the user selection.
dpmo.nc.codes=
The default locale used by the production system. The default locale
is the locale used to display locale
specific text and messages when the requested locale is not
available. This property does not need to
be set if the default locale is english.
default.locale=en
Used when running the build from Eclipse to locate the java compiler
used by the WebLogic EJB compiler.
jdk.home=C:/Program Files/Java/jdk1.5.0_20
Compiler debug mode. If set to 'true', debug symbols will be
compiled into the byte code.
compile.debug=true
Keystore alias
security.alias=xxxxx
Keystore password
security.storepass=ChangeIt
Key password
security.keypass=ChangeIt
Keystore type (jks=default,jceks,pkcs12)
security.storetype=jks
Optional source control build identifier that is to be displayed with
standard version information.
scs.build.ID=
Optional extended version information to be displayed with standard
version information.
ext.info=
custom.properties----
2. How can we change this here?
Regards,
Leon Lu
Edited by: Leon Lu on Aug 4, 2011 11:14 AM
Edited by: Leon Lu on Aug 4, 2011 11:21 AMHi,
I created one request with logo in the header an page in the footer etc. and called StyleSheet. After you can import this formats by each request.
You can do this in compound layout.
Regards,
Stefan -
Passing parameters for a query throught XML and capturing response in the same
Hi All,
I have defined a RequestParameters object and i am passing paramerts for a query through XML and trying to capture the result in the same and send back to the source. In this case i am send XML from excel.
Below is my XML format.
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Insert xmlns="http://tempuri.org/">
<dataContractValue>
<dsRequest>
<dsRequest>
<SOURCE></SOURCE>
<ACTION>Insert</ACTION>
<RequestParams>
<RequestParams>
<ACC_NO>52451</ACC_NO>
<EMP_CITY>HYD</EMP_CITY>
<EMP_NAME>RAKESH</EMP_NAME>
<EMP_CONTACT>99664</EMP_CONTACT>
<EMP_JOM>NOV</EMP_JOM>
<EMP_SALARY>12345</EMP_SALARY>
</RequestParams>
<RequestParams>
<ACC_NO>52452</ACC_NO>
<EMP_CITY>HYD</EMP_CITY>
<EMP_NAME>RAKESH</EMP_NAME>
<EMP_CONTACT>99664</EMP_CONTACT>
<EMP_JOM>NOV</EMP_JOM>
<EMP_SALARY>12345</EMP_SALARY>
</RequestParams>
</RequestParams>
</dsRequest>
<dsRequest>
<SOURCE></SOURCE>
<ACTION>Update</ACTION>
<RequestParams>
<RequestParams>
<ACC_NO>52449</ACC_NO>
<EMP_CITY>HYD1</EMP_CITY>
<EMP_NAME>RAKESH1</EMP_NAME>
<EMP_SALARY>1345</EMP_SALARY>
</RequestParams>
<RequestParams>
<ACC_NO>52450</ACC_NO>
<EMP_CITY>HYDer</EMP_CITY>
<EMP_NAME>RAKEH</EMP_NAME>
<EMP_SALARY>1235</EMP_SALARY>
</RequestParams>
</RequestParams>
</dsRequest>
</dsRequest>
</dataContractValue>
</Insert>
</s:Body>
</s:Envelope>
Where i have a List of dsRequest and RequestParams, where i can send any number of requests for Insert,Update. I have two a XML element defined in RequestParams "RowsEffected","error" where the result will be caputred and is updated
to the response XML.
I have 6 defined in RequestParams
EMP_SALARY(int),ACC_NO(int),EMP_CITY(string),EMP_NAME(string),EMP_CONTACT(string),EMP_JOM(string)
My Question is:
When i am trying to build response XML with the following code, the parameters which are not given in the Request XML are also appearing in the Response.
ResponseParams.Add(
newdsResponse()
ACTION = OriginalParams[a].ACTION,
SOURCE = OriginalParams[a].SOURCE,
Manager = OriginalParams[a].Manager,
RequestParams = OriginalParams[a].RequestParams
Where the OriginalParams is dsRequest
Ex: In my update query i will only send three parameters, but in my response building with ablove code, i am getting all the variables defined as INT in the RequestParameters.
Is there any way i can avoid this and build response with only the parameters given in the Request ??
Appreciate ur help..Thanks
Cronsey.Hi Kristin,
My project is, User will be giving the parameters in the excel, and using VBA, the values are captured and an XML is created in the above mentioned format and is send to web service for the Insert/Update.
I created a webservice which reads the values from <datacontract> and it consist of list of <dsRequests> where any number of Insert/Upate commands can be executed, with in which it contains a list of <RequestParams> for multiple insertion/Updation.
//function call
OriginalParams = generator.Function(query, OriginalParams);
where OriginalParams is List<dsRequest>
//inside function
command.Parameters.Add()// parameters adding
int
val = command.ExecuteNonQuery();
after the execution,an XML element is added for the response part.and it is looped for all the RequestParams.
OriginalParams[i].Result.Add(
newResult()
{ ERROR = "No Error",
ROWS_EFFECTEFD = 1 });
//once all the execution is done the response building part
for(inta
= 0; a < OriginalParams.Count; a++)
ResponseParams.Add(
newdsResponse()
Result = OriginalParams[a].Result
QUEST: When i am trying to build response XML with the following code, the parameters which are not given in the Request XML are also appearing in the Response.
Ex: In my update query i will only send three parameters, but in my response building with ablove code, i am getting all the variables defined as INT in the RequestParameters.
Is there any way i can avoid this and build response with only the parameters given in the Request ??
Appreciate ur help..Thanks
Cronsey. -
IDOC_AAE sender adapter XML : missing encoding="UTF-8"?
Hi All,
We have a IDOC to JMS scenario using IDOC_AAE as sender channel.
Symptom
The IDOC whihc we have received from ECC should add XML version and encoding information to the created IDOC XML file.
Other Terms
IT SHOULD BE AS
<?xml version="1.0" encoding="UTF-8"?>
But we are getting as <?xml version="1.0" >
Can you please share your views on this ?
Regards.,
SivaShiva,
Add XML AnonymizerBean in target channel module to replace/Add UTF encoding.
AF_Modules/XMLAnonymizerBean
Regards
Aashish Sinha -
Using XSLT to link XML and ABAP data
Hi Experts,
I am using XSLT to deal with XML and ABAP data.
I using the following statement to convert a Internal Table to XML String:
CALL TRANSFORMATION id SOURCE root = lt_sflight RESULT XML l_xml_string.
And I get the XML String:
<?xml version="1.0" encoding="utf-16" ?>
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<ROOT>
<SFLIGHT>
</SFLIGHT>
<SFLIGHT>
</SFLIGHT>
</ROOT>
</asx:values>
</asx:abap>
But What I expected is:
<?xml version="1.0" encoding="utf-16" ?>
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<ROOT>
<DATA>
</DATA>
<DATA>
</DATA>
</ROOT>
</asx:values>
</asx:abap>
Could you tell me how to get my dream format using XSLT?
Best Regards,
Guo Guo Qing
Edited by: guoqing guo on Jun 11, 2008 9:58 AMHi Experts,
I am using XSLT to deal with XML and ABAP data.
I using the following statement to convert a Internal Table to XML String:
CALL TRANSFORMATION id SOURCE root = lt_sflight RESULT XML l_xml_string.
And I get the XML String:
<?xml version="1.0" encoding="utf-16" ?>
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<ROOT>
<SFLIGHT>
</SFLIGHT>
<SFLIGHT>
</SFLIGHT>
</ROOT>
</asx:values>
</asx:abap>
But What I expected is:
<?xml version="1.0" encoding="utf-16" ?>
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<ROOT>
<DATA>
</DATA>
<DATA>
</DATA>
</ROOT>
</asx:values>
</asx:abap>
Could you tell me how to get my dream format using XSLT?
Best Regards,
Guo Guo Qing
Edited by: guoqing guo on Jun 11, 2008 9:58 AM -
UTF-8, Unicode, XML and windows problems
Hi there,
I'm developing an application which uses a lot of russian text.
This russian text is stored in XML and can be sent to a server remotly
I use the standard javax.xml libaries to parse the xml files and DBunits XMLWriter to write generate XML strings.
The XML returned by the DBunit stuff is UTF-8, but its inside a UTF-16 string.
So when I generate xml and print it out I get something that looks like the following:
��������� ������������ ���������?����Thats ok, beacause I can stick that streight into a file when writing files and it works.
But the problem comes when sending the XML over the server.
The sending implentation I use must be able to send java generated utf-16 and xml read utf-8.
So I convert the XML from utf-8 to utf-16, using the following:
byte[] stringBytesISO = isoString.getBytes("ISO-8859-1");
utf8String = new String(stringBytesISO, "UTF-8");And that works perfectly on my linux system.
However when I run it on windows, it only seems to convert some of the characters
Привычным �?ном за�?нут дороги до ве�?ны,Does anyone know whats going wrong here?jammers1987 wrote:
I use the standard javax.xml libaries to parse the xml files and DBunits XMLWriter to write generate XML strings.DbUnit is a testing tool; are you saying you're using it in a production system? Ideally, you should use the same library to write the XML as you do to read it, but you definitely shouldn't be using DbUnit in this context.
The XML returned by the DBunit stuff is UTF-8, but its inside a UTF-16 string. That should never happen. XML is just text, and text can either be in the form of a Java string, or it can be stored externally using a text encoding like UTF-8. Never mind that Java strings use the UTF-16 encoding; you don't need to know or mention that. Encodings only come into play when you're communicating with something outside your program, like a file system or a database.
When you generate the XML, you specify that the encoding is UTF-8. When you read the XML, you specify that the encoding is UTF-8. That's all. -
hi all
It would be appreciated if any one let me know how to edit
bitmap which is imported in flash using xml and save the edited
bitmap back to xml in flash.
Is it posible to save the bitmap data in flash?
thanks in advanceYes you can... but like I said before you need to upload the
data from the changes you make to a server.
In terms of the solution... its unlikely that you'll find one
specifically for your needs. You will have to learn whatever you
don't know how already and maybe adapt some existing examples to
your needs.
To change the visual state of a movie clip... you just do all
the regular things that you want to do to it using flash... scale,
rotation, drawing API , textfields etc in actionscript. If you
don't know how to how to do that stuff, then you need to learn that
first. That's basic actionscript.
You can capture the visual state of a movieclip using the
BitmapData class. That includes a loaded jpeg. You can also
manipulate bimatp data using the same class. You should read up on
that if you don't know how to use it or check out the examples
below for uploading info.
For uploading to the server:
Here's an as2 solution that took 15 secs to find using
google:
http://www.quasimondo.com/archives/000645.php
If you're using as3, google search for "jpeg encoder as3" and
look through that info. There are also historical answers in the
forums here related to this type of thing that might help as
well. -
when i started my cityville from facebook the loading progress stopped at 73%.. when it stop i need to download file en-US.xml and gameSettings.xml
this is the download URL for gameSettings.xml : http://cityvillefb.static.zgncdn.com/54988/gameSettings.xml.z
and this is the download URL for en-US.xml :
http://cityvillefb.static.zgncdn.com/54988/en_US.xml.z
when i used version 5.0.1 i never met any problem like this..!!
and i already use adobe flash player higher than version 10
so how can i fix this problem..??Hi Scott,
in SDIXML_DATA_TO_DOM you can only pass the name of root node, so you can not assign attribute xmlns to root node (<Data xmlns="ServiceNet">) ... unless you build the xml document from scratch (without SDIXML_DATA_TO_DOM)
when using your sample code (without sale) I get xml without <item>
SDIXML_DATA_TO_DOM => SDIXML_DOM_TO_SCREEN::
<?xml version="1.0" encoding="utf-8" ?>
- <Data>
<LV_XMINS>xmlns="DUMMY FIELD</LV_XMINS>
<BATCHDATETIME>2009-11-13T12:05:58</BATCHDATETIME>
</Data>
regards, Karsten -
Ejb-jar.xml and orion-ejb-jar.xml configuration issue
Chris,
We have an application that uses the Oracle 10g Application Server and WebSphere MQ v5.3 w/ fixpack 9.
Our application is a J2EE messaging system which essentially consists of Message Driven Beans, the EJB
realization of the J2EE Java Message Service (JMS) API. Our application has Message Driven Beans which
listen to queues and send messages to queues -- a simple messaging system. Currently we can listen to queues, but
cannot send messages to queues in the Oracle 10g Application Server environment.
Any J2EE application server has its own implementation of Java Naming Directory Interface (JNDI) API that
deployed J2EE applications utilize to lookup resources such as Data Sources, JMS Destinations (i.e. MQ Queue),
JMS QueueConnectionFactories (i.e. MQ QManagers).
Our application uses the 3rd party JMS Provider, WebSphere MQ.
MQ ships with a JMSAdmin tool which allows one to create JMS administered objects (i.e. objects a java
application searches for in some JNDI directory) that reside in some JNDI context. We create a JNDI context for
MQ resources, queues and QManagers. We configure the MQ provided
JMSAdmin tool with two property name/value pairs:
PROVIDER_URL=file:/opt/mqm/JNDI-Directory
INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
A resultant .bindings file is created in /opt/mqm/JNDI-Directory which represents our JDNI context
containing our JMS administered objects. A standalone java application that needs to directly access this
JNDI context can simply conduct a JNDI lookup on the following context: "java:comp/resource/MQSeries/". An
example of how a standalone application would lookup a JMS administered object named "qNumber1" would be to
lookup "java:comp/resource/MQSeries/qNumber1". This lookup would result in the standalone java application
having a JMS reference to an MQ Queue.
There is a major difference in how an enterprise EJB application deployed into a J2EE Container (Oracle 10g App Server)
conducts a JNDI lookup on a 3rd party resource such as MQ as a JMS Provider. A typical EJB application deployed
into a J2EE container as an .ear (enterprise archive) file has implicit access to the application server's own
JNDI context. This JNDI context is usually "java:comp/env/". Looking up the Application Server's own Data Source or
it's own JMS Resources is easy. An application that needs references to these Application Server provided resources
simply conducts a lookup for "java:comp/env/jms/someQ" or "java:comp/env/jdbc/myDataSource".
The problem we face is mapping our MQ JNDI context to the Oracle App Server's own JNDI context. We believe this is
accomplished through mappings defined in both the ejb-jar.xml (EJB Descriptor) and the application server specific
counterpart, orion-ejb-jar.xml. Note that Oracle 10g Application Server uses the popular orion J2EE container for
hosting J2EE enterpise applications.
Our Message Driven Beans (MDBs)currently listen to the Queue at the JNDI location "prodQ". Our problem is that we cannot
get our MDB to send messages to any queues. Note that the MQ implementation of the queues and Queue Managers work
flawlessly with standalone java applications. It's safe to say that the MQ objects are working.
We are looking for a solid example of how the ejb-jar.xml and the orion-ejb-jar.xml map 3rd party JMS provider
JNDI locations to the App Server's JNDI context.
Below is how we have attempted to configure our own ejb-jar.xml and orion-ejb-jar.xml:
ejb-jar.xml begin >>>>>>>>>>>>>>><?xml version = '1.0' encoding = 'UTF-8'?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<display-name>Production Message Driven Bean</display-name>
<enterprise-beans>
<message-driven>
<display-name>prodMdb</display-name>
<ejb-name>prodMdb</ejb-name>
<ejb-class>message.handler.AIDMSMessageConsumerBean</ejb-class>
<transaction-type>Bean</transaction-type>
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
</message-driven-destination>
<resource-ref>
<res-ref-name>prodQCF</res-ref-name>
<res-type>javax.jms.QueueConnectionFactory</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-ref>
<res-ref-name>prodQ</res-ref-name>
<res-type>javax.jms.Queue</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-ref>
<res-ref-name>prodR</res-ref-name>
<res-type>javax.jms.Queue</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
</message-driven>
</enterprise-beans>
</ejb-jar>
<<<<<<<< ejb-jar.xml end <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
begin orion-ejb-jar.xml >>>>>>>>>>>>>>>>>>>>>>>>>>><orion-ejb-jar>
<enterprise-beans>
<message-driven-deployment name="prodMdb" connection-factory-location="java:comp/resource/MQSeries/prodQCF" destination-location="java:comp/resource/MQSeries/prodR">
<resource-ref-mapping location="prodQ" name="prodQ">
<lookup-context location="java:comp/resource/MQSeries/" >
<!-- <context-attribute name="java.naming.factory.initial"
value="com.sun.jndi.fscontext.RefFSContextFactory" /> -->
</lookup-context>
</resource-ref-mapping>
<resource-ref-mapping location="prodR" name="prodR">
<lookup-context location="java:comp/resource/MQSeries/" >
<!-- <context-attribute name="java.naming.factory.initial"
value="com.sun.jndi.fscontext.RefFSContextFactory" /> -->
</lookup-context>
</resource-ref-mapping>
</message-driven-deployment>
</enterprise-beans>
</orion-ejb-jar>
<<<<<<<<< end orion-ejb-jar.xml <<<<<<<<<<<<<<<<<<<<<<<<If you look at the contents of a deployment plan (Plan.xml) when you have it generated
<deployment-plan ...>
<module-override>
<module-name>ejb.jar</module-name>
<module-type>ejb</module-type>
<module-descriptor external="true">
<root-element>weblogic-ejb-jar</root-element>
<uri>META-INF/weblogic-ejb-jar.xml</uri>
</module-descriptor>
<module-descriptor external="false">
<root-element>ejb-jar</root-element>
<uri>META-INF/ejb-jar.xml</uri>
</module-descriptor>
<module-descriptor external="true">
<root-element>persistence-configuration</root-element>
<uri>META-INF/persistence-configuration.xml</uri>
</module-descriptor>
<module-descriptor external="false">
<root-element>persistence</root-element>
<uri>META-INF/persistence.xml</uri>
</module-descriptor>
</module-override>
</deployment-plan>You can see which files can be external and which can be not. The weblogic-ejb-jar.xml can be external
but in this case you need a deployment plan to point weblogic to the file. The ejb-jar.xml cannot be
external (see external=false)
The benefit of storing the weblogic-ejb-jar.xml is that your administrator can fine tune certain
configurations by using a deployment plan, instead of having to extract the contents from the jar file
and then repackage it again.
No need to worry about a clustered environment, you can place the jar and the deployment plan
on the server where the admin server is located, when you deploy an application you deploy it to
the cluster and everything is taken care off.
More information on deployment plans can be found here: http://download.oracle.com/docs/cd/E11035_01/wls100/deployment/config.html -
Difference/relationship between XML and XSD
Hi All,
Correct me if i am wrong,
When we create a source and a target datatype in IR automatically objects will be created in XSD.
The same way it does when we create message type.
In message mapping, We map source and target message type and when we test with sample data, we can view source and target in xml
My question is what is the difference/relationship between XML and XSD ?
Thanks,
ssHi,
XML (Extensible Markup Language) is a W3C initiative that allows information and services to be encoded with meaningful structure and semantics that computers and humans can understand. XML is great for information exchange, and can easily be extended to include user-specified and industry-specified tags.
Whereas
An XML Schema Definition (XSD) is an instance of an XML schema written in the XML Schema language. An XSD defines a type of XML document in terms of constraints upon what elements and attributes may appear, their relationship to each other, what types of data may be in them, and other things. It can be used with validation software in order to ascertain whether a particular XML document is of that type, and to produce a Post-Schema Validation Infoset.
I hope this clarifies.
Regards.
Praveen -
How to retrieve version and encoding info from SAX parser
I want to have access to the version and encoding info in a parsed XML document (when using SAX2). Who knows how this works?
If not possible with SAX2, what other solutions are there?
Second question: how to retrieve comments in XML files?
Thanks in advance!thanks for answering, but ...
LexicalHandler is fine for retrieving the comments,
but does not give me the encoding (specified by
encoding="UTF-8") and version (specified by
version="1.0").
I am feeding my parser with a byte stream, the parser
resolves the correct encoding and i want to have
access to this value!!hi , It is unlikely that you will get the encoding and version . This is being addressed by the DOM level3
, see
http://www-106.ibm.com/developerworks/xml/library/x-dom3.html?dwzone=xml . -
Loading settings from xml and applying
Hi,
I've got an xml where im writing certain settings of a application. This is what the xml looks like;
<?xml version="1.0" encoding="UTF-8" ?>
- <PTMViewProfile>
- <viewProfile>
<testSequences />
<projectName tag="default" />
- <tsFrames>
<tsFrame tag="bvcbvc" maximised="true" />
<tsFrame tag="bvbv" maximised="true" />
</tsFrames><projectName tag="default" /> - This is the project name
- <tsFrames> - These are the JInternalFrames (Instance of tsFrames) for that specific project.
<tsFrame tag="bvcbvc" maximised="true" />
<tsFrame tag="bvbv" maximised="true" />
</tsFrames>
The project is stored in a directory containing all the tsFrames.
From the xml i have the code to read and write. But, i want to apply those settings so that when the application is reopened it looks at the xml and opens project and the tsFrames by looking at the xml.
Can someone please help me with wrting a method that applies those settings and loads the application.Hi,
Thanks for replying!
I am new to java and i have created the read and write method by using examples from existing code.
what i want to do is store the elements its reading into an array so that i can use it in another method to do things with it.
The code below is reading element from xml
List frame = XMLManager.getListOfNamedChildren(tsFrames, xmlFrameTag);
Iterator iterator = frame.iterator();
while (iterator.hasNext()) {
Element tsFrameElement = (Element) iterator.next();
String tag = XMLManager.getAttributeValue(tsFrameElement, "tag");
String maximised = XMLManager.getAttributeValue(tsFrameElement, "maximised");
storeTsFrame.add(new TSFrameSettings(tag, maximised));I want to use a for each loop to read each line in the xmlFrametag by replacing the while
can someone help me with this please! -
Flat file transformation to xml with encoding in iso-8859-1
We have a BPEL process that picks up a flat fle (fixed length), transforms it to xml and emails it. The flat file is in iso-8859-1 (when I look at special characters like e-accent's in hex).
The basic transformation that you get from (the wizards) of BPEL don't do the trick, the special characters are corrupted and unreadable.
After that I changed all the encoding's (in xsd's and xsl's) from utf-8 into iso-8859-1 but doesn't help either. I also added an xsl:output section to my xsl (with "encoding="iso-8859-1") but that also fails...
Does anyone have a clue? We're using SOA Suite 10.1.3.1.
greetings,
Janjust tried that but the problem is still there
I suspect that the output of the file adapter (reading the flat file) is already corrupted, you should be able to tell the file adapter what encoding the input file is... -
Draw figures from a xml and then draw anothers when I click on them
This is what I have to do:
I got a XML file with the info of a drawing: circles, rectangles.....
I read the file and I draw the figures on a JPanel.
And now what I have to do is this:
When I click on a figure I have to recognize what figure is, for example, rectangle number 2 on the XML file. Then I have to read the XML and foud what I have to draw when I click on that figure, this info is on the XML:
<Transition Rectangle="2" NextDraw="Rectangle 3" />
How do I draw all these figures and keep the info I need (name and number of the figure)? And how do I manage mouse events for recognize the click on a figure for draw anothers.
Sorry for my bad english and thanksI don't know the structure of your XML file.
Anyway, I guess it's something like the following :
shapes.xml
<?xml version="1.0" encoding="UTF-8"?>
<shapes>
<Transition Rectangle="1" NextDraw="Rectangle 2" />
<Transition Rectangle="2" NextDraw="Rectangle 3" />
<Transition Rectangle="3" NextDraw="Circle 1" />
<Transition Circle="1" NextDraw="Circle 2" />
<Transition Circle="2" NextDraw="Circle 3" />
<Transition Circle="3" />
</shapes>Here the java code. Plz, take a look at it and adapt it to your needs.
XMLParserHandler.java
import java.util.HashMap;
import java.util.Map;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;
public class XMLParserHandler extends DefaultHandler {
Map<String, String> shapes;
public XMLParserHandler(){
shapes = new HashMap<String, String>();
public void startDocument() throws SAXException {
//System.out.println("Start Shapes Document.xml");
shapes = new HashMap<String, String>();
public void endDocument() throws SAXException {
//System.out.println("End Shapes shapes.xml");
public void startElement(String uri, String localName, String qName,
Attributes attributes) throws SAXException {
//System.out.println("Start Element : " + qName);
//display(attributes);
if("TRANSITION".equals(qName.toUpperCase())){
String key = null;
String value = "";
int n = attributes.getLength();
String attrName;
for (int i = 0; i < n; i++) {
attrName = attributes.getQName(i);
if(! "NEXTDRAW".equals(attrName.toUpperCase())){
key = new String(attrName+" "+attributes.getValue(i));
}else{
value = new String(attributes.getValue(i));
if(key!=null){
shapes.put(key.toUpperCase(), value.toUpperCase());
public void endElement(String uri, String localName, String qName)
throws SAXException {
//System.out.println("End Element : " + qName);
public void characters(char[] ch, int start, int length)
throws SAXException {
//System.out.println(new String(ch, start, length));
public void error(SAXParseException e) throws SAXException {
throw e;
public void fatalError(SAXParseException e) throws SAXException {
throw e;
public Map<String, String> getShapes() {
return shapes;
private void display(Attributes attrs){
int n = attrs.getLength();
for (int i = 0; i < n; i++) {
System.out.println("***"+attrs.getQName(i)+" = "+attrs.getValue(i));
MyPanel.java
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.swing.JPanel;
public class MyPanel extends JPanel {
static String CIRCLE = "CIRCLE";
static String RECTANGLE = "RECTANGLE";
public List shapeList;
int currentIndex = 0;
Shape currentShape;
public MyPanel(Map shapes, String entry) {
createShapeList(shapes, entry);
addMouseListener(new MyMouseListener());
private String getShapeName(String value){
return value.split("\\s+")[0];
private void createShapeList(Map shapes, String entry){
shapeList = new ArrayList();
Shape shape=null;
String key = new String(entry);
String value ;
int i=0;
do{
value=getShapeName(key);
System.out.println(value);
if(CIRCLE.equals(value)){
shape = new Ellipse2D.Double(5, 5+40*i, 20, 20);
System.out.println("==> added circle");
}else if(RECTANGLE.equals(value)){
shape = new Rectangle2D.Double(5, 5+40*i, 20, 20);
System.out.println("==> added rectangle");
shapeList.add(shape);
key = (String)shapes.get(key);
i++;
}while(value!=null&&value.trim().length()>0);
currentShape = (Shape)shapeList.get(currentIndex);
class MyMouseListener extends MouseAdapter{
public void mouseClicked(MouseEvent e) {
int x = e.getX();
int y = e.getY();
if(currentShape.contains(x, y)){
if(currentIndex<shapeList.size()-1){
currentIndex++;
currentShape = (Shape)shapeList.get(currentIndex);
repaint();
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
g2.setPaint(Color.red);
for (int i = 0; i < currentIndex+1; i++) {
g2.fill((Shape)shapeList.get(i));
Main.java
import java.io.File;
import java.util.Map;
import javax.swing.JFrame;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
public class Main {
public static void main(String[] args) {
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser parser;
Map myShapes = null;
try {
parser = spf.newSAXParser();
XMLParserHandler handler = new XMLParserHandler();
parser.parse(new File("shapes.xml"), handler);
myShapes = handler.getShapes();
String entry = "RECTANGLE 1";
//Create and set up the window.
JFrame frame = new JFrame("MyFrame");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Create and set up the content pane.
MyPanel newContentPane = new MyPanel(myShapes, entry);
newContentPane.setOpaque(true); // content panes must be opaque
frame.setContentPane(newContentPane);
// Display the window.
frame.setSize(400, 400);
frame.setResizable(false);
frame.setVisible(true);
}catch(Exception e){
e.printStackTrace();
NB: as mentioned in the Main class (see main method), you should provide the main entry for your xml file : String entry = "RECTANGLE 1";Hope That Helps -
Hello everyone,
i am writing a little application that uses SAX to parse XML documents and i am having a bit of a problem with german Umlaut (e.g. �, �, �). I looked up the entities that are commonly used in the internet, so for example � becomes either ä or ä , but now for some incomprehensible weird reason those entities are changed into something like for example ä...
Could anybody help me out with this problem? I am completely lost and don't even know what's going on here any more. Maybe my PC is developing a vicious life of its own...
Thanks
ChrisHere's what's happening, then.
Your XML is being written in UTF-8. This is the default encoding for XML and it represents characters that aren't in the ASCII character set by 2 or more bytes. For Latin accented characters it uses 2 bytes. When you read that file back into your program, you must specify the encoding; if you don't, then the system will incorrectly assume that the file is encoded in whatever is the default for your system. To do this:Reader r = new InputStreamReader(new FileInputStream(yourFile), "UTF-8");
Maybe you are looking for
-
Regarding Mail: When I return to my computer after it has gone to sleep, my accounts go offline, and are always asking me for the password. THis is very annoying. How can I prevent this?
-
Issue with OBIEE 10.1.3.4.2 in MUDE mode
Can any one help me in getting bug list of OBIEE 10.1.3.4.2? Actually we are experiencing issues in using MUDE. When creating any new logical or use any physical objects by creating alias to it we get issue with the newly created objects. Hence we ar
-
Deleting all images in iPhoto in Desktop
I have deleted all photos in iPhoto thinking the images would be deleted from the "Desktop" section in Systems Perferences. Did not happen. The imags are still there! How do I delete the images/photos under the iPhoto menu in desktop? To be very sp
-
hi all what does the value like this ___________,__V in the text field of a particular field in the screen attributes means can anyone tell what it does and what is the purpose. i have seen it in the attributes of a particular field in the screen lay
-
What is the easiest way to connect a PNP (current sinking) encoder to a counter-timer? I need to trigger some electronics using a PNP encoder, and it appears the 6612 counter-timer only accepts NPN (line driver) inputs. Is there an easy way to do t