Re: [oXygen-user] Dynamic parameter in oxy_path

2019-10-28 Thread Christian Achter
... and your answer 
 
absolutely solved solved my problem. I feel a bit ashame I didn't have 
the idea myself to step outside of the string literal and compute the 
attribute value first.


I also learnt today  
that one should not say "thank you" in a comment on Stackoverflow so I 
say thank you here, dear Radu.


Kind regards
Christian


Am 28.10.2019 um 07:50 schrieb Oxygen XML Editor Support (Radu Coravu) :

Hi Christian,

I replied to you on the StackOverflow post:

https://stackoverflow.com/questions/58581679/xpath-and-css-in-oxygen-xml-author-how-to-create-a-dynamic-parameter-in-oxy-xpa/58586584#58586584 



Regards,
Radu

Radu Coravu
 XML Editor
http://www.oxygenxml.com

On 10/25/2019 4:25 PM, Christian Achter wrote:

Dear mailinglist members.

I am creating an Oxygen framework to display XML data in Oxygen XML 
Author's Author mode. This is part of the XML I have with two nodes 
 in it:



 
 
 
 
 
 
Aarberg,
 Peter von
 
 König
 (ca. 
1300–vor 1372)

 
 
 
 
 hkg:orgKey="#n_123_456">Best CEO they ever had

 
 
 
 

 type="organization">

 
 Altenburger Hofdruckerei
 
 
 
 
 


The upper  node has an atribute hkg:orgKey="#n_123_456" pointing 
to second element's xml:id="n_123_456". I use the following CSS to 
display the value of  of the second element in the visual 
representation of the first element:


affiliation:after {
 content: " role: " oxy_textfield(
     edit, "@role")
     " Organization ID: " oxy_textfield(
     edit, "@hkg:orgKey")
     "Organization name: " oxy_xpath(
"/TEI/text/body/div/ab[@xml:id='n_123_456']/seg[@type='name']/orgName/text()" 


     )
     " " oxy_url("gfx/link_register.png");
     link: attr("hkg:orgKey")
}

This works fine. But now I need to create the line

"/TEI/text/body/div/ab[@xml:id='n_123_456']/seg[@type='name']/orgName/text()" 



dynamically which means: Instead of the specific value xml:id 
n_123_456 it should use whatever the value of the attribute 
@hkg:orgKey of the node  is. I tried this:


"/TEI/text/body/div/ab[@xml:id=@hkg:orgKey]/seg[@type='name']/orgName/text()" 



but it doesn't work. I also tried other variations like 
ab[@xml:id='@hkg:orgKey'] or ab[@xml:id=attr('hkg:orgKey')] and many 
more but none of them gave me the expected result.


Maybe it is a syntax problem. I really hope there will be a solution 
to this and I would be very thankful for assistance. Any help is 
appreciated.


I tried to send as much code as needed but of course shortened some 
parts not relevant in this case. If something is missing (or too 
much) please let me know.


Thanks in advance and kind regards
Christian Achter
University of Bern


___
oXygen-user mailing list
oXygen-user@oxygenxml.com
https://www.oxygenxml.com/mailman/listinfo/oxygen-user


___
oXygen-user mailing list
oXygen-user@oxygenxml.com
https://www.oxygenxml.com/mailman/listinfo/oxygen-user
___
oXygen-user mailing list
oXygen-user@oxygenxml.com
https://www.oxygenxml.com/mailman/listinfo/oxygen-user


Re: [oXygen-user] Dynamic parameter in oxy_path

2019-10-28 Thread Oxygen XML Editor Support (Radu Coravu)

Hi Christian,

I replied to you on the StackOverflow post:

https://stackoverflow.com/questions/58581679/xpath-and-css-in-oxygen-xml-author-how-to-create-a-dynamic-parameter-in-oxy-xpa/58586584#58586584

Regards,
Radu

Radu Coravu
 XML Editor
http://www.oxygenxml.com

On 10/25/2019 4:25 PM, Christian Achter wrote:

Dear mailinglist members.

I am creating an Oxygen framework to display XML data in Oxygen XML 
Author's Author mode. This is part of the XML I have with two nodes  
in it:



     
     
     
     
     
     
Aarberg,
     Peter von
     
     König
     (ca. 
1300–vor 1372)

     
     
     
     
     hkg:orgKey="#n_123_456">Best CEO they ever had

     
     
     
     

     
     
     Altenburger Hofdruckerei
     
     
     
     
     


The upper  node has an atribute hkg:orgKey="#n_123_456" pointing to 
second element's xml:id="n_123_456". I use the following CSS to display 
the value of  of the second element in the visual 
representation of the first element:


affiliation:after {
     content: " role: " oxy_textfield(
         edit, "@role")
         " Organization ID: " oxy_textfield(
         edit, "@hkg:orgKey")
         "Organization name: " oxy_xpath(
"/TEI/text/body/div/ab[@xml:id='n_123_456']/seg[@type='name']/orgName/text()"
         )
         " " oxy_url("gfx/link_register.png");
         link: attr("hkg:orgKey")
}

This works fine. But now I need to create the line

"/TEI/text/body/div/ab[@xml:id='n_123_456']/seg[@type='name']/orgName/text()" 



dynamically which means: Instead of the specific value xml:id n_123_456 
it should use whatever the value of the attribute @hkg:orgKey of the 
node  is. I tried this:


"/TEI/text/body/div/ab[@xml:id=@hkg:orgKey]/seg[@type='name']/orgName/text()" 



but it doesn't work. I also tried other variations like 
ab[@xml:id='@hkg:orgKey'] or ab[@xml:id=attr('hkg:orgKey')] and many 
more but none of them gave me the expected result.


Maybe it is a syntax problem. I really hope there will be a solution to 
this and I would be very thankful for assistance. Any help is appreciated.


I tried to send as much code as needed but of course shortened some 
parts not relevant in this case. If something is missing (or too much) 
please let me know.


Thanks in advance and kind regards
Christian Achter
University of Bern


___
oXygen-user mailing list
oXygen-user@oxygenxml.com
https://www.oxygenxml.com/mailman/listinfo/oxygen-user


___
oXygen-user mailing list
oXygen-user@oxygenxml.com
https://www.oxygenxml.com/mailman/listinfo/oxygen-user


[oXygen-user] Dynamic parameter in oxy_path

2019-10-25 Thread Christian Achter

Dear mailinglist members.

I am creating an Oxygen framework to display XML data in Oxygen XML 
Author's Author mode. This is part of the XML I have with two nodes  
in it:



    
    
    
    
    
    
Aarberg,
    Peter von
    
    König
    (ca. 
1300–vor 1372)

    
    
    
    
    hkg:orgKey="#n_123_456">Best CEO they ever had

    
    
    
    

    
    
    Altenburger Hofdruckerei
    
    
    
    
    


The upper  node has an atribute hkg:orgKey="#n_123_456" pointing to 
second element's xml:id="n_123_456". I use the following CSS to display 
the value of  of the second element in the visual 
representation of the first element:


affiliation:after {
    content: " role: " oxy_textfield(
        edit, "@role")
        " Organization ID: " oxy_textfield(
        edit, "@hkg:orgKey")
        "Organization name: " oxy_xpath(
"/TEI/text/body/div/ab[@xml:id='n_123_456']/seg[@type='name']/orgName/text()"
        )
        " " oxy_url("gfx/link_register.png");
        link: attr("hkg:orgKey")
}

This works fine. But now I need to create the line

"/TEI/text/body/div/ab[@xml:id='n_123_456']/seg[@type='name']/orgName/text()" 



dynamically which means: Instead of the specific value xml:id n_123_456 
it should use whatever the value of the attribute @hkg:orgKey of the 
node  is. I tried this:


"/TEI/text/body/div/ab[@xml:id=@hkg:orgKey]/seg[@type='name']/orgName/text()" 



but it doesn't work. I also tried other variations like 
ab[@xml:id='@hkg:orgKey'] or ab[@xml:id=attr('hkg:orgKey')] and many 
more but none of them gave me the expected result.


Maybe it is a syntax problem. I really hope there will be a solution to 
this and I would be very thankful for assistance. Any help is appreciated.


I tried to send as much code as needed but of course shortened some 
parts not relevant in this case. If something is missing (or too much) 
please let me know.


Thanks in advance and kind regards
Christian Achter
University of Bern

___
oXygen-user mailing list
oXygen-user@oxygenxml.com
https://www.oxygenxml.com/mailman/listinfo/oxygen-user