Page 1 of 1

Author mode links (ID, IDREF, key, keyref)

Posted: Thu Feb 14, 2008 3:56 pm
by Uli
Hi,

how could links via ID, IDREF or key keyref feature being
displayed in author mode?
I want to produce two different styles.
- Display a html like link which jumps to the place where the
key information is displayed
- Display the information from the key right in the place
where the keyref was defined

Example:

Code: Select all


<myxml>
<type id="1">Info 1</type>
<type id="2">Info 2</type>
<elem type="2">Elem 1</elem>
<elem type="1">Elem 2</elem>
</myxml>
The type/@id and the elem/@type are linked via key/keyref.

In author mode now i want the following:

1.

Elem1

Type: Info 2
This should be a link to the according type element


2.

Elem 1

Type:

Info 2
....


Best regards, Uli

Re: Author mode links (ID, IDREF, key, keyref)

Posted: Fri Feb 15, 2008 7:02 pm
by sorin_ristache
Hello,
Uli wrote:how could links via ID, IDREF or key keyref feature being displayed in author mode?
I want to produce two different styles.
- Display a html like link which jumps to the place where the key information is displayed
The next version (oXygen 9.2) will introduce the CSS property link which is rendered as an HTML link and which opens the referenced file. We will consider allowing the link to jump also to the exact element referenced in the link by scrolling the editor panel to that element but I am not sure if this will go in version 9.2.
Uli wrote:- Display the information from the key right in the place where the keyref was defined
This will be possible when a CSS property will be allowed to specify an XPath expression that is executed on the XML document associated with that CSS stylesheet. It will be implemented in a future version of oXygen.


Regards,
Sorin

Re: Author mode links (ID, IDREF, key, keyref)

Posted: Thu Jul 30, 2009 4:28 pm
by sijomon
Is there any further information about this 'link' property. I've tried adding it to my framework's CSS but I get the following error:

Code: Select all


Engine name: W3C CSS Validator
Severity: error
Description: Context : xref in property : link
Property link doesn't exist in CSS level 2.1 but exists in : url(attr(href))

Start location: 5:0
Have you an example of how this feature is intended to work?

Re: Author mode links (ID, IDREF, key, keyref)

Posted: Fri Jul 31, 2009 10:08 am
by sorin_ristache
Hello,

The link property is a custom property used in Oxygen. You can find examples of using it in the User Manual and in the default CSS for DocBook documents, that is ${frameworks}/docbook/css/docbook.css.


Regards,
Sorin

Re: Author mode links (ID, IDREF, key, keyref)

Posted: Fri Jul 31, 2009 12:51 pm
by sijomon
Hi,

Maybe I'm being dumb, but the examples don't seem to work for me.

I've created the following test files to see what I'm doing wrong, can you take a look and advise please. (I'm using Oxygen 10.3)

XML File to be styled in author mode with clickable links:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="testLinks.css"?>
<content xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://prot.domain.com/testLinks testLinks.xsd">
<links>
<link href="http://www.google.com">Here is the first link</link>
<link href="http://www.google.com">Here is the second link</link>
</links>
</content>
Schema file for above XML:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="content">
<xs:complexType>
<xs:sequence>
<xs:element ref="links"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="links">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="link"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="link">
<xs:complexType mixed="true">
<xs:attribute name="href" use="required" type="xs:anyURI"/>
</xs:complexType>
</xs:element>
</xs:schema>
CSS file to style <link> elements with 'href' attribute as clickable links using Oxygen specific 'link' property:

Code: Select all


link[href]:before{
link:attr(href);
}

link{
display: block;
}
When i associate all these files together in Oxygen and go to author mode the link elements are not rendered as clickable links. Furthermore the CSS validator complains about the 'link' property being invalid; I appreciate thats beacuse this isn't a true CSS 2.1 property, but can we extend the default validator to include the oxygen specific stuff?

Thanks,

Simon.

Re: Author mode links (ID, IDREF, key, keyref)

Posted: Fri Jul 31, 2009 2:10 pm
by sorin_ristache
Hello,

You have to specify content property for link element. The clickable content is content property.

Code: Select all

link[href]:before{
link:attr(href);
content: "Click " attr(href) " for opening" ;
}
The user cannot extend the CSS validator. We will consider extending it for validation of link property.


Regards,
Sorin