Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. XML / CSL Macros

XML / CSL Macros

Scheduled Pinned Locked Moved XML / XSL
xmljsonquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi all, I am looking for some documentation of using macros or functions within XML. The program, Zotero, stores it data in a modified form of XML they call CSL. I am looking for means of manipulating authors that are all in uppercase within the controlling XML Reference Style, and capilizing the first letter then making the rest lowercase. e.g. lastname, LASTName, LastName --> Lastname. I would also like to capture things like McEwan and **O'**Reily. These simple types of text manipulations are found in many languages, e.g. lower(), upper(), proper() and instr(). What are the equivalents for use in XML? Simon

    L 1 Reply Last reply
    0
    • L Lost User

      Hi all, I am looking for some documentation of using macros or functions within XML. The program, Zotero, stores it data in a modified form of XML they call CSL. I am looking for means of manipulating authors that are all in uppercase within the controlling XML Reference Style, and capilizing the first letter then making the rest lowercase. e.g. lastname, LASTName, LastName --> Lastname. I would also like to capture things like McEwan and **O'**Reily. These simple types of text manipulations are found in many languages, e.g. lower(), upper(), proper() and instr(). What are the equivalents for use in XML? Simon

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      SimonCropper wrote:

      I am looking for means of manipulating authors

      I am guessing that means the Text context of a TextNode which is of course a child of an ElementNode. It might be possible to accomplish this using Javascript and an XSLT Processor that supports user functions. I think I remember using one of the Microsoft Processors that supports that, perhaps they all do, I don't know because I would not use that mechanism unless I had no other choice. Fortunately, in this case you have another choice. Using a compiled programming language (C#, C++, whatever), load the file in a DOM, query for the elements of interest, read the current Text, modify the Text (your capitalization), write it back into the element. Finally the last step would be to persist the changed XML back into it's storage location, e.g. Disk File or Database or whatever.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups