Remove XML attribute and value
Hi All,
I require to delete the attribute and value in xml structure.
Below code is not working due to ":" (aid:cstyle) between attribute name.
JS code is:
evaluateXPathExpression("//typestyle[@aid:cstyle = 'bold']")
If I remove colon and change it to aidcstyle than it is working. How to read : (colon)?
Also it is showing alert message again and again.
Please help.
Chang.
for the first problem there are two fixes:
first one (simple, normal, no ideea why it's not there already) declare your aid (and aid5) namespaces in your xml. For example:
<Root xmlns:aid=”http://ns.adobe.com/AdobeInDesign/4.0/”
xmlns:aid5=”http://ns.adobe.com/AdobeInDesign/5.0/”>
second one: more advanced xpath, if it works, using local_name() and namespace-uri(). My xpath-expert is not at work right now, so i can't help you more with this until he's back.
second problem... no real fix for now. some characters that indesign uses (indentToHere and rightIndentTab, as far as I know, but may be others too) have no UTF equivalent, so you get that warning. you can eitehr ignore it, or, as I do, before doing anything with XML in scripting, i change the said characters to some marking (##RIT## and ##ITH##), and change them back after changing the XML
Similar Messages
-
CR Reports 2008: Space Between HTML Attribute and Value Causes Attribute To Be Ignored
I have a field in a report with its Text interpretation set to "HTML Text". When content is rendered in that field that was sourced from a Microsoft Word document, some of the attributes seem to be ignored by Crystal.
For example, I have observed with "style" attributes that if there is a space between the attribute and the value, e.g. "FONT-FAMILY: SimSun" then Crystal will not render the Asian characters, replacing them with squares. However, if I manually remove the space so that the attribute appears as "FONT-FAMILY:SimSun", then the characters properly render as expected. I have observed the same issue with at least one other attribute as well, "FONT-SIZE".
This html does render properly in various browsers, so it seems to be an issue with Crystal Reports. Can you provide me with information about this and if there is a fix for it in subsequent versions. The version I tested with is 2008 - 12.5.0.1190.
Thanks for any assistance that you can provide.hi Ethan,
here are the list of supported html tags in text interpretation...font family is indeed a supported tag.
does the html appear properly in the designer?...you mentioned various browsers and am wondering if you mean the crystal web viewers?
if the issue is in your cr designer, you may wish to patch it to the latest level.
also, ensure that you do not have any unsupported tags in your html that may be causing an issue.
-jamie
html
body
div (causes a paragraph break)
tr (causes only a paragraph break; does not preserve column structure of a table)
span
font
p (causes a paragraph break)
br (causes a paragraph break)
h1 (causes a paragraph break, makes the font bold & twice default size)
h2 (causes a paragraph break, makes the font bold & 1.5 times default size)
h3 (causes a paragraph break, makes the font bold & 9/8 default size)
h4 (causes a paragraph break, makes the font bold)
h5 (causes a paragraph break, makes the font bold & 5/6 default size)
h6 (causes a paragraph break, makes the font bold & 5/8 default size)
center
big (increases font size by 2 points)
small (decreases font size by 2 points if it's 8 points or larger)
b
i
s
strike
u
The supported HTML attributes are:
align
face
size
color
style
font-family
font-size
font-style
font-weight
In Crystal Reports 2008 Service Pack 2 and above, the following additional HTML tags and attributes have been added to the supported list:
The supported HTML tags are:
ul ( bulleted list )
ol ( ordered list )
li ( tag defining a list item used for both list type: ul and ol. )
Important Note: The bullet will not show up as a regular size bullet, but as a small dot.
The supported HTML attributes are:
strong ( bold ) -
Function module to get attribute and value from organisation model
Hi
I need a function module to get the attribute and its corresponding values set on the sales org stucture.The export parameter will be the Sales Org Id.
Please reply ASAP.
Edited by: prem kumar on Apr 16, 2009 9:37 AMHi Prem,
If it helps, we use FM RHGA_READ_ATTRIBUTES for that in version 4.
Kind regards,
Garcia -
Difference between value attribute and value attribute under Node in contex
I have very basic question..it might be very simple but it is giving me a problem.
I have created one Node name "Input" and value attribute "Input1" under it.
I have just created one more value attribute named "in1" not under any Node.
I have created two input filed in the my view.One first I have mapped the value in properties
to variables "Input.Input1" and on another "in1".
When I deploy and run the application one Input box is coming as readonly and other is working fine .Will anybody tell me why it is so?There is no major difference between value attribute and inside a node.
It is a separation of attributes. Usually all the attributes belongs to same purpose will create in one value node. Like, calling one BAPI - requestListBAPI - it contains all the bapi related value attributes.
For your question, one field is read only(Input.Input1), bcz that context is not created. see the context properties.....cardinality will be 0..n. Change the cardinality to 1...n (<b>or</b>) create that context element .
In your implementation create that value node like this in your init method.
wdContext.createInputElement();
It will solve your problem.
in1 - is a value attribute, which is mapped to your input element. It wont have any problem.
Regards,
Sri -
XML attributes and object types
I want to create an XML Document of the following form
<family>
<parent attr1="val1">
<child attr2="val2" attr3="val3"/>
</parent>
</family>
Using object table and object type (for the child element), I am able to produce the following XML Document (with a "select * from family" query)
<family> <!-- rowset -->
<parent> <!-- row -->
<attr1>val1</attr1>
<child>
<attr2>val2</attr2>
<attr3>val3</attr3>
</child>
</parent>
</family>
The question is: how am I going to query these data so that the "attr" elements are mapped to attributes (using XSU only, without XSLT)?
I have already tried the following:
1. Using
SELECT attr1 as "@attr1",
f.child.attr2 "@attr2",
f.child.attr3 "@attr3"
FROM family f
all the attributes are obviously appended to the "parent" element.
2. Using nested table for "child" and the following query
SELECT attr1 as "@attr1",
CURSOR (
SELECT n.child.attr2 as "@attr2", n.child.attr3 as "@attr3"
FROM TABLE(f.child n)
) AS "child"
FROM family f
I am getting the following document
<family>
<parent attr1="val1">
<child>
<child_ROW attr2="val2" attr3="val3"/>
</child>
</parent>
</family>
Is there a smart SQL query to produce the desired document? What data types
is it recommended to use to define my db schema (object types, nested tables...)?
Thank you in advance
nullFinally, I got the desired XML format output from relational tablse using schema based XMLType views.
Wherein I created Object Types from relational table, generated the schema for the Object type, registered the schema and finally created XMLType Views for populating the XML data from Relational Tables.
I guess, you all might aware of my problem, where I got struck. Instead of printing the data in XML format I am successful in generating the XML format data Using the Query Select from BLABLA_Type_view* . I am able to print the number of rows, that I require which is in the fallowing format.
Column Name
1. SYS.XMLTYPE ----- As a row
The view I am querying for is printing the data in a string format, where in I got to do the fallowing query
SELECT SYS.XMLTYPE.getStringVal(OBJECT_VALUE) FROM BLABLA_Type_view. Which ultimately gave me the required data in XML format with tags.
Thanks for every one who tried to give a try to solve, especially "mdrake" -
Datagrid - XML attributes and text
Please help with this. I am trying to load XML data into
datagrid. If I use only text nodes or attributes, I can get it
work. But if I have mixed XML content, I cannot get data I need.
All examples I've found so far use or just attributes or just
nodes. No mixed content.
<myDatas>
<data id="1">
<name nickname="jay"> JACK</name>
</data>
How to show all data in datagrid using HTTP service in
FlexBuilder?
<mx:DataGridColumn headerText="PROJEKT"
dataField="@id"/>
<mx:DataGridColumn headerText="ID" dataField="NAME"/>
<mx:DataGridColumn headerText="PONUDA"
dataField="@nickame"/>
This example shows just first two of them. I cannot get
nickname shown nut even using labelFunction. Also, I have more
complexed XML than this.
Please help & thank you.Sorry for the typos Tracy. I've tryed to make it short and
clear to understand the problem. Here is (I hope) more litterate
version :)
xmlFile:
<myDatas>
<DATA id="1">
<NAME nick="jay">JACK</NAME>
<SURNAME middle="what">JILL</SURNAME>
</DATA>
<DATA />
</myDatas>
part of mxml file
<mx:HTTPService
id="dataFeed"
url="
http://localhost/data.xml"
useProxy="false"
/>
<mx:Script>
<![CDATA[
private function getAttributeNick(item:Object,
column:DataGridColumn):String
return (item["NAME"]["nick"]);
<!-- I cannot make this work but you'll get idea -->
private function getAttributeUniversal(item:Object,
column:DataGridColumn):String
return (this["item."+ column.dataField]);
]]>
</mx:Script>
<mx:DataGrid
dataProvider="{dataFeed.lastResult.myDatas.DATA}" >
<mx:columns>
<mx:DataGridColumn headerText="ID" dataField="@id"/>
<mx:DataGridColumn headerText="NAME"
dataField="NAME"/>
<mx:DataGridColumn headerText="SURNAME"
dataField="SURNAME"/>
<-- this I cannot get to work -->
<mx:DataGridColumn headerText="NICKNAME-!OK"
dataField="NAME.@nick"/>
<mx:DataGridColumn headerText="SUR2-!OK"
dataField="SURNAME.@middle"/>
<!-- this works but I would like not to write function
for each attribute I may have -->
<mx:DataGridColumn headerText="NICKNAME-OK"
labelFunction="getAttributeNick"/>
<!-- so I try to send in some data -->
<mx:DataGridColumn headerText="SUR2 !OK"
dataField="SURNAME.@middle"
labelFunction="getAttributeUniversal"/>
</mx:columns>
</mx:DataGrid>
Thank you for your interest. -
GP context attributes and values?
Hi Everyone!
I am pretty new in the business and I'm looking for the values of the structure attributes of a gp. Like I can find IGPProcessInstance/Template/LocalParameters/Attributes (Collection)/Structures/Structureslist/elementdata/GPAttributeInfo and there I have the neccessary parameter name, but how do I get the value of this for a running instance? Where is it stored?
Thanx for all replies,
SandorAs it is possible to view the context parameters in Monitoring, I would like to create a DC that is in the portal, and it shows all the running GPs of a certain template with the local parameters of the last completed block in one table. So I wanted a general algorithm by that I can get into the block substructure and get the local parameters of a completed block of a running GP. For later developments I simply need to get the attribute values of the block6 instance.
But as I started out from the ProcessInstance, I was stopped by the block '1a0' that had no child elements available. Though there must be some.
Also if I ask for a block in the substructure using "getBlockInstance(String processId, String blockId, IUser user)" gaining the necessary BlockID from Monitoring, I can only get the template structure of that block, that has no attribute values.
I give the TemplateID of the GPs that are to be listed to the component through the application parameter field in the PortalContent. Because in the end it should be compatible with any GP structure.
Regards, Sandor -
Dynamically removing context attribute
Hi all,
does anybody know a better way of getting rid of dynamically created attributes than using the IWDContext.reset() functionality?
Best regards,
ChristianHi,
We had the similar requirement .We have mailed to Uwe regarding this.Please find the reply below .
there is currently no way to remove a single attribute in NW04. There is only the possibility to reset the metadata to the state that has been declared in the design time. This can be achieved using IWDContext.reset(boolean), reachable via wdContext.getAPI(). The method removes all attributes and nodes, that have been added at run time ("dynamically"), via one of the add Attribute or add Child methods of IWDNode. So, if you have added the root attribute at runtime, this method will remove it, but it removes all other dynamically added attributes and nodes, too.
NW05 will allow to remove single attributes and child nodes, but still only if they have been dynamically added before.
Regards
Anil -
Creating attributes with value as CDATA
is it possible to create elements with attributes and values where values are CDATA
You can't use a CDATA section as the value of an attribute, if that's what you were asking.
-
Get the attributes NAME and VALUE from an XML
I really love this forum :)
I load an XML an populate a Tree, from which I start to drag
items.
the xml looks like this:
<myTag attrName="attrValue"
otherAttrName="otherAttrValue"/>
var ds:DragSource = event.dragSource;
var var1:String =(event.dragInitiator as
Tree).value.@attrName;
-> the var1 variable has now: "attrValue"
my question is.. how can I get all the attributes' names? in
this example: attrName and otherAttrName (suppose I don't know the
structure of that xml node)
what about attributes values?
thank you!The snippet below takes an xml node(nodeCur), loops over the
attributes list and builds an array that contains the attribute
name and value for each attribute. It comes from a sample app that
allows you to edit an xml file.
Sorry that the forum will remove the formatting
var aDPAttributes:Array = new Array();
var xlAttributes:XMLList = nodeCur.@*;
var attribute:Attribute;
for ( var i:int = 0; i < xlAttributes.length(); i++) {
aDPAttributes.push({name:xlAttributes [ i ]
.name(),value:xlAttributes [ i ] });
dgAttributes.dataProvider = aDPAttributes; //set the property
sheet dataProvider
Tracy -
How to remove the XML attribute value in Indesign file by javascript
Hi all,
How to remove the XML attribute value in Indesign file.Try this,
if(elm.xmlElements[i].xmlAttributes[j].name == "aid:pstyle" || elm.xmlElements[i].xmlAttributes[j].name == "aid:cstyle")
Vandy -
Printing parameter values in xml report, and displaying it in header of the
Hi All,
Can anybody give me an idea to print the parameter values in the xml report.
My requirement is like, I have 10 parameters in report builder, I have generated the xml file and created the .rtf template and finally registerted in oracle apps. But now, the requirement is to print the parameter values in the report output.I don't see any xml tags in the xml output.
Any suggestion will be appreciated.
Thanks in advance.I think all the XML attributes can contain lexicals. If you bring up the property palette against the report object you can just set the following:
XML Tag Attributes: myParameter="&<P_1>"
where P_1 is your user parameter. -
How to get the name and value of an attribute on a node/element that is not a child
Hello,
Can someone shed some wisdom on how I can compare 2 xml nodes for differences.
My main challenge is I need to use the attributes/values of 'ProductDescription' and 'Features' as 'key' to identify the same node in
another doc with the same layout, but different content.
I am having trouble getting the name of the attribute on the node, 'ProductDescription' and 'Features'. I can only seem to get the node names, but not the attributes on the node. I need the name, because it can be different from doc to doc, so
I can't hardcode this.
Can someone please help with how to retrieve an attribute name/value on a node that is not a child. Here's an example of what
my xml looks like:
DECLARE
@myDoc1 xml
,@mydoc2 xml
DECLARE
@ProdID int
SET @myDoc1 ='<ProductDescription ProductID="1" ProductName="Road Bike">
<Features featureID = "1" featureName = "body">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
</Features>
<features featureID = "2" featureName = "seat">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
</Features>
</ProductDescription>
SET @myDoc2 ='<ProductDescription ProductID="1" ProductName="Road Bike">
<Features featureID = "1" featureName = "body">
<Warranty>2 year parts and labor</Warranty>
<Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
</Features>
<features featureID = "2" featureName = "wheel">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
</Features>
</ProductDescription>
I need to compare the attributes of 'ProductDescription' and 'Features' from @mydoc1 against @mydoc2 to see if they are the same based on those 2 nodes first. If they are, then i want to show the difference in the child elements.
This will eventually be an outer join to give me the differences betw the 2 docs based on those key values (node attributes).
I used node('//*') for the path, and value('local-name(../.)', 'varchar(50)') as element
,value('.[not(@xsi:nil = "true")]','VARCHAR(255)') AS new_value
...etc...
but that only gives me the node names, and the child elements. It does not give me back the attribute names and values from the node itself.
Thanks in advance for your help.
ceeAre you looking for something like this:
DECLARE @myDoc1 xml
SET @myDoc1 ='<ProductDescription ProductID="1" ProductName="Road Bike">
<Features featureID = "1" featureName = "body">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
</Features>
<Features featureID = "2" featureName = "seat">
<Warranty>1 year parts and labor</Warranty>
<Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
</Features>
</ProductDescription>'
SELECT T.c.value('local-name(.)', 'nvarchar(50)') AS name,
T.c.value('.', 'nvarchar(50)') AS value
FROM @myDoc1.nodes('ProductDescription/@*') AS T(c)
Erland Sommarskog, SQL Server MVP, [email protected] -
Trying to assign an XML attribute value to a button label
I have a Flex app (developed in FLEX 2) that reads from
multiple XML files and populates datagrids with element values.
What I'm trying to do now, is to create a second column with a
button, enabling users to view archived versions for each current
report.
My problem is: I can't get the <mx:Button> label to
accept the attribute "name". I've tried atleast 10 - 20 different
syntax.
My XML file looks like this:
<metrics>
<report name="test">
<link>test Report 10/28/2008</link>
<url>test-10_28_2008.zip</url>
<status>active</status>
</report>
</metrics>
The mxml looks like this:
<mx:Button buttonMode="true" useHandCursor="true"
click="handleClick()" label="{data.@name}" width="80">
<mx:Script>
<![CDATA[
public function handleClick():void{
var url:URLRequest = new
URLRequest([L=http://new.test.com/pages/r_archive_apps/"+data.link+".html");[/L]]http://n ew.test.com/pages/r_archive_apps/"+data.link+".html");[/L][/L]
navigateToURL(url,"_blank");
]]>
</mx:Script>
</mx:Button>
When I try to label a button with an element it works fine.
Some of the other sytax I've used are:
- label="{data.report.@name}"
- label="{data.report.(@name=='test')}"
- label="{data.report.(@name='test')}"
- label="{data.@name}"
- label="{data.metrics.report.@name}"
- label="{data.metrics.report.(@name=='test')}"
- label="{data.metrics.report.(@name='test')}"quote:
Originally posted by:
rtalton
Can you post some code so we can see how you are using the
button? I think you may be using the button within a datagrid
itemRenderer, which might make a difference.
You're right, the button is in a datagrid itemRenderer. I've
pasted more dataGrid code below - thanks again.
<mx:DataGrid id="dgCatalog" dataProvider="{_xlcCatalog}"
rowCount="4" editable="false" sortableColumns="false"
left="148" top="65" bottom="42" borderStyle="solid"
alternatingItemColors="[#ecf8ff, #ffffff]"
themeColor="#ffff80" alpha="1.0" cornerRadius="0"
dropShadowEnabled="true" dropShadowColor="#000000" width="549"
creationCompleteEffect="{glow3}">
<mx:columns>
<mx:Array>
<mx:DataGridColumn editable="false" headerText="Daily -
Report Names" dataField="link" textAlign="left" width="200">
<mx:itemRenderer>
<mx:Component>
<mx:LinkButton click="handleClick()" label="{data.link}"
>
<mx:Script>
<![CDATA[
public function handleClick():void{
var url:URLRequest = new URLRequest("
http://test.new.com/test/"+data.url);
navigateToURL(url,"_blank");
]]>
</mx:Script>
</mx:LinkButton>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn editable="false" headerText="Daily -
Report Archives" dataField="link" textAlign="left" width="80">
<mx:itemRenderer>
<mx:Component>
<mx:Button buttonMode="true" useHandCursor="true"
click="handleClick()" label="{data.report.@name}" width="80">
<mx:Script>
<![CDATA[
public function handleClick():void{
var url:URLRequest = new URLRequest("
http://test.new.com/pages/test_apps/"+data.link+".html");
navigateToURL(url,"_blank");
]]>
</mx:Script>
</mx:Button>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<!--mx:DataGridColumn headerText="URL" dataField="url"
width="350"/>
<mx:DataGridColumn headerText="Status" dataField="status"
width="70"/-->
</mx:Array>
</mx:columns>
</mx:DataGrid> -
How to print the attribute name and value?
Hi, All,
I am learning Jaxp and DOM.
I am trying to parse a xml document using DOM as
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.parse( new File(argv[0]) );
Assume that my xml have three levels. For each node, there is only one attribute (key).
Now I would like to print the name of all the nodes and the name of all the attributes and their values.
Would youn please provide me some ideas?
Thanks.
AGhttp://java.sun.com/webservices/docs/1.3/tutorial/doc/JAXPDOM4.html
Maybe you are looking for
-
The exe gives this error report ''347542828.exe szAppName : firefox.exe szAppVer : 2.0.1.4120 szModName : hungapp szModVer : 0.0.0.0 offset : 00000000 C:\DOCUME~1\Mom\LOCALS~1\Temp\WER84c3.dir00\firefox.exe.mdmp C:\DOCUME~1\Mom\LOCALS~1\Temp\WER84c3.
-
Check Box values not reflecting in the pageflow instace variable
Hello BEA Experts, I am binding a checkBox group to an instance variable of a Pageflow , it seems that the array inside the pageflow is null no matter what can you please let me know why. Is it possible to bind the checkbox group tag to an array in P
-
Dear all, In Miro , I use deliver note or po for reference document then I enter the reference document number . the system is called that reference document . but quantity is equal to PO quantity. But I have to see goods receipt quantity . how can
-
Hai, I am using Java Web Server 1.2 . In JSP , when I use ResultSet.previous(), it is saying that : java.sql.ResultSet.previous() command not found. I do not know what to do ? But, In java file, it is working fine without any problem .But, I need to
-
Error "Comatose" when leave the master node.
Hi All, I'm trying to configured cluster on OES11 and i have many problems with it. this is one of: OES5:~ # cluster status Master_IP_Address_Resource Running OES1 3 DATAP_SERVER Comatose OES5 6 The error "commatose" show on status of data resource w