Search found 41 matches

by mboudreau
Wed Dec 11, 2019 12:21 am
Forum: SDK-API, Frameworks - Document Types
Topic: Custom menu of options for InsertFragmentOperation
Replies: 14
Views: 531

Re: Custom menu of options for InsertFragmentOperation

Ah, those quotes! I've gotten tripped up on that before. Since I want to choose the <journal> element from subject_headings.xml based on the content of /article/front/journal-meta/journal-id[@journal-id-type="publisher-id"] in the file being edited, I expanded the example to this: <article-categorie...
by mboudreau
Mon Dec 09, 2019 11:47 pm
Forum: SDK-API, Frameworks - Document Types
Topic: Custom menu of options for InsertFragmentOperation
Replies: 14
Views: 531

Re: Custom menu of options for InsertFragmentOperation

Hm. Stumped again. With this file: <?xml version="1.0"?> <subject-headings> <journal id="AJS"> 'AJS Article':'AJS Article'; 'AJS Editorial':'AJS Editorial'; 'AJS Review':'AJS Review' </journal> <journal id="BBL"> 'BBL Article':'BBL Article'; 'BBL Editorial':'BBL Editorial'; 'BBL Review':'BBL Review'...
by mboudreau
Fri Dec 06, 2019 11:07 pm
Forum: SDK-API, Frameworks - Document Types
Topic: Custom menu of options for InsertFragmentOperation
Replies: 14
Views: 531

Re: Custom menu of options for InsertFragmentOperation

Thanks, Sorin! This is what finally works: ${ask('Choose or type a subject heading:', editable_combobox, (${xpath_eval( if ( doc-available(concat('${framework}/resources/subjects_', /article/front/journal-meta/journal-id[@journal-id-type="publisher-id"], '.xml')) ) then string(doc(concat('${framewor...
by mboudreau
Thu Dec 05, 2019 10:52 pm
Forum: SDK-API, Frameworks - Document Types
Topic: Custom menu of options for InsertFragmentOperation
Replies: 14
Views: 531

Re: Custom menu of options for InsertFragmentOperation

Hi Sorin, I'm trying your suggestion of using the "doc" function. I started with a very simple version just to see if Oxygen could locate the file: ${ask('Select subject heading', combobox, (${xpath_eval( if ( doc-available(${framework}/resources/subject_headings.txt) ) then "'A':'A';'B':'B';'C':'C'...
by mboudreau
Thu Dec 05, 2019 12:14 am
Forum: SDK-API, Frameworks - Document Types
Topic: Custom menu of options for InsertFragmentOperation
Replies: 14
Views: 531

Re: Custom menu of options for InsertFragmentOperation

One more follow-up. As I noted previously, this works: ${ask('Choose one', combobox, (${xpath_eval(if (matches(/article/front/journal-meta/journal-id[@journal-id-type="publisher-id"]/text(), 'Journal A', 'i')) then "'A':'A';'B':'B';'C':'C'" else "'D':'D';'E':'E';'F':'F'")}) )} And when I worked prev...
by mboudreau
Wed Dec 04, 2019 8:34 pm
Forum: SDK-API, Frameworks - Document Types
Topic: Custom menu of options for InsertFragmentOperation
Replies: 14
Views: 531

Re: Custom menu of options for InsertFragmentOperation

I finally worked out the syntax for the ${ask()} with an embedded ${xpath_eval()}: ${ask('Choose one', combobox, (${xpath_eval(if (matches(/article/front/journal-meta/journal-id[@journal-id-type="publisher-id"]/text(), 'Journal A', 'i')) then "'A':'A';'B':'B';'C':'C'" else "'D':'D';'E':'E';'F':'F'")...
by mboudreau
Wed Dec 04, 2019 12:25 am
Forum: SDK-API, Frameworks - Document Types
Topic: Custom menu of options for InsertFragmentOperation
Replies: 14
Views: 531

Re: Custom menu of options for InsertFragmentOperation

I'm trying to implement the middle option, using ${ask()} and ${xpath_eval()}. I can get this work as the fragment to be inserted: <article-categories> <subj-group> <subject>${ask('Choose one', combobox, ('Article':'Article'; 'Book Review':'Book Review'; 'Editorial':'Editorial'))}</subject> </subj-g...
by mboudreau
Wed Nov 27, 2019 5:57 am
Forum: SDK-API, Frameworks - Document Types
Topic: Custom menu of options for InsertFragmentOperation
Replies: 14
Views: 531

Re: Custom menu of options for InsertFragmentOperation

To follow up, I've figured out how to style the inserted element to display a menu of choices: article-categories subj-group subject:before { content:"Subject: " oxy_combobox( edit, '#text', values, 'Research Article, Brief Report, Obituary', fontInherit, true); } article-categories subj-group subje...
by mboudreau
Tue Nov 26, 2019 12:28 am
Forum: SDK-API, Frameworks - Document Types
Topic: Custom menu of options for InsertFragmentOperation
Replies: 14
Views: 531

Custom menu of options for InsertFragmentOperation

I'm creating a framework author action to add a subject heading to a document when it's missing. E.g., /article/front/article-meta/article-categories/subj-group/subject At the moment, however, my action only adds this fragment with the placeholder "My Heading" as the text content of <subject>. What ...
by mboudreau
Mon Nov 04, 2019 5:18 am
Forum: XSLT and FOP
Topic: Framework conflict
Replies: 3
Views: 160

Re: Framework conflict

Is there any way to avoid this? If I needed to convert an instance of one DTD into an instance of the other DTD, and I couldn't have both frameworks active at the same time, I'd be stuck.
by mboudreau
Mon Oct 28, 2019 10:26 pm
Forum: XSLT and FOP
Topic: Framework conflict
Replies: 3
Views: 160

Framework conflict

I appear to have a conflict between two frameworks I set up, and I don't know how to troubleshoot this. I have a framework I've been using without problems for over a year, which is configured as follows: Framework: "Journal Publishing 3.0" Association rules - Public ID: -//NLM//DTD Journal Publishi...
by mboudreau
Thu Oct 24, 2019 2:33 am
Forum: XSLT and FOP
Topic: Can I save the DOCTYPE declaration to a variable?
Replies: 1
Views: 85

Can I save the DOCTYPE declaration to a variable?

I'd like to write a single XSL transformation that can process instances of different (but similar) doctypes. I also want to include the input doctype declaration in the output, so I can't write specific values into an <xsl:output> element. Is there a way to capture the content of the doctype declar...
by mboudreau
Thu Jun 07, 2018 5:31 pm
Forum: XSLT and FOP
Topic: Variable definition not processed when variable isn't output
Replies: 4
Views: 1900

Re: Variable definition not processed when variable isn't output

Removing the <xsl:otherwise> element doesn't help.

However, it appears that "string($volume) = ''" and "not(string($volume))" both work as a test for the undefined variable.
by mboudreau
Wed Jun 06, 2018 10:12 pm
Forum: XSLT and FOP
Topic: Variable definition not processed when variable isn't output
Replies: 4
Views: 1900

Re: Variable definition not processed when variable isn't output

Hi, I'd like to pick this topic up again to ask what's the best practice when you need to set a variable and you also need to know if the variable has unexpectedly not been set? In this case, I'm processing JATS XML files that may or may not have a <volume> element. So my stylesheet has this at the ...
by mboudreau
Thu Mar 08, 2018 9:01 pm
Forum: Common Problems
Topic: XML refactoring removes CDATA markup
Replies: 1
Views: 779

XML refactoring removes CDATA markup

I tried using the XML Refactoring tool to add an attribute to an element that has CDATA content, e.g., <tex-math notation="LaTeX"> <![CDATA[ \( E = mc^2 \) ]]> </tex-math> When I added the attribute 'version="MathJax"', the CDATA markup was stripped out, leaving me with <tex-math notation="LaTeX" ve...
by mboudreau
Wed Feb 14, 2018 7:15 pm
Forum: Common Problems
Topic: CSS for JATS related-article and self-url elements
Replies: 3
Views: 1048

Re: CSS for JATS related-article and self-url elements

Thanks, Radu. That showed me that my rules for related-article:before and self-url:before were being superseded by this from authorDefaults.css: *[xlink|href]:before { content : url(../images/link.png) ; -oxy-link : attr(xlink|href) !important ; } I don't find a file 'authorDefaults.css' anywhere on...
by mboudreau
Wed Feb 14, 2018 12:59 am
Forum: Common Problems
Topic: CSS for JATS related-article and self-url elements
Replies: 3
Views: 1048

CSS for JATS related-article and self-url elements

I'm working with JATS-like files that may include <self-uri> and <related-article> elements. The elements have no content, but I want to display some of their attribute values even when in Partial Tags or No Tags mode. To do this I am modifying the jats-authoring.css and jats-authoring-labelled.css ...
by mboudreau
Thu Feb 01, 2018 12:31 am
Forum: SDK-API, Frameworks - Document Types
Topic: Action to run multiple updates on the source document
Replies: 3
Views: 1657

Re: Action to run multiple updates on the source document

Thanks, Alex. I set up the action as follows, and it does what I want: Operation: XSLTOperation Arguments sourceLocation: /article targetLocation: /article script: ${framework}/xslt/verify.xsl action: Replace caretPosition: First editable position expandEditorVariables: true suspendTrackChanges: fal...
by mboudreau
Tue Jan 30, 2018 6:08 am
Forum: SDK-API, Frameworks - Document Types
Topic: Action to run multiple updates on the source document
Replies: 3
Views: 1657

Action to run multiple updates on the source document

I have an XSLT script that performs two types of actions on an XML document: Issues warnings (using <xsl:message>) if it finds markup errors it cannot correct Makes some easy corrections (e.g., change <month>1</month> to <month>01</month> throughout the document) On the command line, this transforma...
by mboudreau
Wed Jan 17, 2018 7:08 pm
Forum: SDK-API, Frameworks - Document Types
Topic: Associating DTD public identifier with local DTD file
Replies: 9
Views: 3306

Re: Associating DTD public identifier with local DTD file

Thanks, Radu. I commented out the <group> tags, and everything works.
by mboudreau
Tue Jan 16, 2018 11:44 pm
Forum: SDK-API, Frameworks - Document Types
Topic: Associating DTD public identifier with local DTD file
Replies: 9
Views: 3306

Re: Associating DTD public identifier with local DTD file

I've been working with this solution for a while now, and it seems OK. However, I now need to distribute my two frameworks to other people, so I'd like to give them two folders that they can drop into their own 'frameworks' directories. The only obstacle is the catalog files I've created. In each on...
by mboudreau
Wed Nov 08, 2017 7:16 pm
Forum: Common Problems
Topic: XML refactoring preview highlights namespace declarations
Replies: 3
Views: 1337

Re: XML refactoring preview highlights namespace declarations

Hi Alin, Yes, the 'xlink' namespace is also defined on the root element of my document. I don't know why the redundant declaration occurs, but unfortunately I have no control over the files I'm given to work with. It would be convenient if there were an 'Ignore namespaces' option, as there is in the...
by mboudreau
Fri Nov 03, 2017 10:25 pm
Forum: Common Problems
Topic: XML refactoring preview highlights namespace declarations
Replies: 3
Views: 1337

XML refactoring preview highlights namespace declarations

I'm exploring the XML Refactoring tool, and I decided to try making a simple change: sec/title => sec/label In the 'Rename element' dialog box, I specified this: https://www.dropbox.com/s/rpiojvn5odi47gp/XML%20refactoring%201.png?dl=0 But the preview showed this, highlighting namespace declaration c...
by mboudreau
Thu Sep 28, 2017 12:25 am
Forum: XSLT and FOP
Topic: Variable definition not processed when variable isn't output
Replies: 4
Views: 1900

Variable definition not processed when variable isn't output

I was setting up a stylesheet in which I expected to use a number of variables. Two of my variable definitions were as follows: <xsl:variable name="doi"> <xsl:choose> <xsl:when test="/article/front/article-meta/article-id[@pub-id-type = 'doi']"> <xsl:value-of select="/article/front/article-meta/arti...
by mboudreau
Tue Sep 05, 2017 10:22 pm
Forum: XSLT and FOP
Topic: Diff files and namespaces
Replies: 11
Views: 3028

Re: Diff files and namespaces

Thanks, Teo. I uploaded the files and included a link to this forum topic.
by mboudreau
Thu Aug 31, 2017 11:26 pm
Forum: XSLT and FOP
Topic: Diff files, ignore nodes by XPath
Replies: 1
Views: 1508

Diff files, ignore nodes by XPath

Another question about the diff files tool (despite the minor issues I've reported, I'm finding it extremely useful). I'm comparing two HTML files, which I know have only trivial differences in the <img> element @alt attribute value, so I'd like Diff to ignore <img> elements. I have added "//img" to...
by mboudreau
Thu Aug 31, 2017 5:59 pm
Forum: XSLT and FOP
Topic: Diff files and namespaces
Replies: 11
Views: 3028

Re: Diff files and namespaces

Hi Teo, I edited both files to make sure the minus sign is the same character in each, but the math elements are still highlighted as different. I also added your original short math expression to the files, and it too was flagged as different in the two versions, as in this screen shot: https://www...
by mboudreau
Wed Aug 30, 2017 5:28 pm
Forum: XSLT and FOP
Topic: Diff files and namespaces
Replies: 11
Views: 3028

Re: Diff files and namespaces

Thanks, Teo. When I change the character entities in the left file to match the right, the comparison still shows the two math expressions as different: https://www.dropbox.com/s/1monazci64qv2hf/diff%20problem%202.png?dl=0 (Is this the best way to include screen shots in a forum posting? I don't see...
by mboudreau
Wed Aug 30, 2017 12:03 am
Forum: XSLT and FOP
Topic: Diff files and namespaces
Replies: 11
Views: 3028

Re: Diff files and namespaces

Oddly, I can consistently reproduce this problem with large files, but not with small ones, so perhaps some more information would be helpful. I'm using Oxygen 18.1 (build 2016112217). I took your MathML and wrapped it in a few elements to represent in very simplified form what I'm working with. Whe...
by mboudreau
Tue Aug 29, 2017 7:11 pm
Forum: XSLT and FOP
Topic: Diff files and namespaces
Replies: 11
Views: 3028

Re: Diff files and namespaces

Hi Octavian,

I notice that your second file includes the namespace declaration on the 'mml:math' start tag, whereas mine did not. Is this strictly necessary if I have the 'mml' namespace declaration in the root element ('article') start tag?