### XML Element Example Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/SOURCES.md Demonstrates the basic structure of an XML element with a start tag, content, and end tag. Used for defining named properties. ```xml Wizard ``` -------------------------------- ### Install xsltproc on Windows Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/README.md Use Chocolatey to install the xsltproc utility on Windows systems. ```bash choco install xsltproc ``` -------------------------------- ### Install libxslt on macOS Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/README.md Use Homebrew to install the libxslt package on macOS systems. ```bash brew install libxslt ``` -------------------------------- ### Compendium Tag Example Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/SOURCES.md An example of the opening compendium tag with the auto_indent attribute. ```xml ``` -------------------------------- ### Define a Ranger Class in XML Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/SOURCES.md Example of a complete class definition for a Ranger, including all proficiencies, starting wealth, spellcasting details, and autolevel progression. ```xml Ranger 10 Strength, Dexterity, Animal Handling, Athletics, Insight, Investigation, Nature, Perception, Stealth, Survival 3 Light Armor, Medium Armor, Shields Simple Weapons, Martial Weapons None 5d4x10 Wisdom L 0, 2 0, 3 0, 3 0, 4, 2 0, 4, 2 0, 4, 3 0, 4, 3 0, 4, 3, 2 0, 4, 3, 2 0, 4, 3, 3 0, 4, 3, 3 0, 4, 3, 3, 1 0, 4, 3, 3, 1 0, 4, 3, 3, 2 0, 4, 3, 3, 2 0, 4, 3, 3, 3, 1 0, 4, 3, 3, 3, 1 0, 4, 3, 3, 3, 2 0, 4, 3, 3, 3, 2 Starting Ranger As a 1st-level Ranger, you begin play with 10 + your Constitution modifier hit points. You are proficient with the following items, in addition to any proficiencies provided by your race or background. • Armor: light armor, medium armor, shields • Weapons: simple weapons, martial weapons • Tools: none ``` -------------------------------- ### Define a Monster in XML Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/SOURCES.md A complete example of a monster definition including stats, traits, and actions. ```xml Adult Red Dragon H dragon Chaotic Evil 19 (natural armor) 256 (19d12+133) walk 40 ft., climb 40 ft., fly 80 ft. 27 10 25 16 13 21 Dex +6, Con +13, Wis +7, Cha +11 Perception +13, Stealth +6 23 Common, Draconic 17 fire blindsight 60 ft., darkvision 120 ft. Legendary Resistance (3/Day) 3/DAY If the dragon fails a saving throw, it can choose to succeed instead. Multiattack The dragon can use its Frightful Presence. It then makes three attacks: one with its bite and two with its claws. Bite Melee Weapon Attack: +14 to hit, reach 10 ft., one target. Hit: 19 (2d10 + 8) piercing damage plus 7 (2d6) fire damage. Bite|+14|2d10+8 Claw Melee Weapon Attack: +14 to hit, reach 5 ft., one target. Hit: 15 (2d6 + 8) slashing damage. Claw|+14|2d6+8 Tail Melee Weapon Attack: +14 to hit, reach 15 ft., one target. Hit: 17 (2d8 + 8) bludgeoning damage. Tail|+14|2d8+8 Frightful Presence ``` -------------------------------- ### Define a Feat in XML Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/SOURCES.md Example of a feat definition including name, prerequisites, proficiency, description text, and ability score modifiers. ```xml Squat Nimbleness (Dexterity + Acrobatics) Dwarf, Gnome, Halfling, Small Race Acrobatics You are uncommonly nimble for your race. You gain the following benefits: • Increase your Strength or Dexterity score by 1, to a maximum of 20. • Increase your walking speed by 5 feet. • You gain proficiency in the Acrobatics or Athletics skill (your choice). If you're already proficient in the skill, your proficiency bonus is doubled for any check you make with it. • You have advantage on any Strength (Athletics) or Dexterity (Acrobatics) check you make to escape from being grappled. Source: Xanathar's Guide to Everything p. 75 dexterity +1 speed +5 ``` -------------------------------- ### XML Element with Text Content Example Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/SOURCES.md An example of an XML element named 'name' containing text content, representing a specific value like a character's name. ```xml Gandalf the Grey ``` -------------------------------- ### Define a Spell in XML Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/SOURCES.md Full example of a spell definition including name, level, school, casting time, range, components, duration, description text, and roll formulas. ```xml Magic Missile 1 EV Fighter (Eldritch Knight), Sorcerer, Wizard 120 feet V, S Instantaneous You create three glowing darts of magical force. Each dart hits a creature of your choice that you can see within range. A dart deals 1d4+1 force damage to its target. The darts all strike simultaneously and you can direct them to hit one creature or several. At Higher Levels: When you cast this spell using a spell slot of 2nd level or higher, the spell creates one more dart for each slot above 1st. Source: Player's Handbook (2014) p. 257 1d4+1 (1d4+1)+(1d4+1)+(1d4+1) ``` -------------------------------- ### XML Element with Multiple Text Values Example Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/SOURCES.md Demonstrates an element that accepts multiple text values, separated by commas. This is used for properties that can have several associated entries, like classes. ```xml Fighter, Wizard ``` -------------------------------- ### Self-Closing XML Element Example Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/SOURCES.md Shows how to use a self-closing tag for elements that do not contain content or are optional. Useful for template elements. ```xml ``` -------------------------------- ### Define Plate Armor in XML Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/SOURCES.md Example of defining heavy armor with specific properties like AC, strength requirement, and stealth disadvantage. ```xml Plate Armor uncommon HA 65 1500.0 18 1 15 Plate consists of shaped, interlocking metal plates to cover the entire body. A suit of plate includes gauntlets, heavy leather boots, a visored helmet, and thick layers of padding underneath the armor. Buckles and straps distribute the weight over the body. The wearer has disadvantage on Stealth (Dexterity) checks. If the wearer has a Strength score lower than 15, their speed is reduced by 10 feet. Source: Player's Handbook (2014) p. 145 ``` -------------------------------- ### Create Collection File with Simple References Source: https://context7.com/vidalvanbergen/fightclub5exml/llms.txt Collection files list source XML files to merge using simple elements. This method is suitable for basic compendium structures. ```xml ``` -------------------------------- ### Navigate to Repository Root Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/README.md Change the current working directory to the repository root folder. ```bash cd C:\Users\YOUR_USER_NAME\Documents\FightClub5eXML-master ``` ```bash cd /Users/YOUR_USER_NAME/Documents/FightClub5eXML-master ``` -------------------------------- ### Generate partial collection files automatically Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/SOURCES.md Run this utility script to scan a directory for source XML files and generate a corresponding partial collection file. ```bash /Utilities/source-xml-collector.sh /path/to/source/ ``` -------------------------------- ### Validate XML with xmllint Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/SOURCES.md Use the command line to validate an XML file against the provided XSD schema. ```bash xmllint --noout --schema Utilities/compendium.xsd Sources/CoreRulebooks.xml ``` -------------------------------- ### Extend Spell Classes Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/SOURCES.md Example of adding additional classes to an existing spell by creating a partial XML definition. ```xml Magic Missile Bard (Esoteric) ``` -------------------------------- ### Build Collections Script Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/CONTRIBUTING.md Execute the build script to compile collections. This is a recommended step for testing changes before submitting a pull request. ```bash ./build-collections.sh ``` -------------------------------- ### Define Longsword in XML Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/SOURCES.md Example of defining a melee weapon with versatile properties, damage types, and proficiency information. ```xml Longsword common M 3 15.0 V,M 1d8 1d10 S Versatile: This weapon can be used with one or two hands. A damage value in parentheses appears with the property—the damage when the weapon is used with two hands to make a melee Attack. Proficiency: martial, longsword Source: Player's Handbook (2014) p. 149 ``` -------------------------------- ### Batch Compile All Collections with build-collections.sh Source: https://context7.com/vidalvanbergen/fightclub5exml/llms.txt The build-collections.sh script compiles all collection files in parallel. Options include removing edition tags, validating XML, and compiling specific files. ```bash # Compile all collections in the Collections directory ./build-collections.sh # Compile all collections and remove '[5.5e]' tags from output ./build-collections.sh -5.5e # Compile specific collection files only ./build-collections.sh Core_Rulebooks_5e.xml Core_Supplements_5e.xml # Compile with XML schema validation (requires xmllint) ./build-collections.sh --validate # Combine options: compile specific files with tag removal ./build-collections.sh -5.5e WotC_5.5e+Legacy_5e.xml # Output: # Starting compilation using 8 cores. # > Created: 'Core_Rulebooks_5e.xml' # > Created: 'Core_Supplements_5e.xml' # Compilation completed! ``` -------------------------------- ### Build Collections Script Usage Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/README.md Use this bash script to compile all collections in the Collections directory into compendiums. Options allow for removing version tags and specifying individual collections. ```bash Usage: ./build-collections.sh [-5.5e] [-h/?] [collection_names...] -5.5e Remove '[5.5e]' from the generated compendiums. collection_names Optional list of specific collections to compile. -h/? Display this help message. If no collection names are provided, all XML files in the 'Collections' directory will be processed. Examples: ./build-collections.sh Compile all collections. ./build-collections.sh -5.5e Compile all collections and remove '[5.5e]'. ./build-collections.sh collection1.xml Compile only 'collection1.xml'. ./build-collections.sh -5.5e collection1.xml collection2.xml Compile 'collection1.xml' and 'collection2.xml' and remove '[5.5e]'. ``` -------------------------------- ### Define a collection using elements Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/SOURCES.md Use this method for a straightforward list of source XML files. Each referenced file must contain a root element. ```xml ``` -------------------------------- ### Define Longbow in XML Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/SOURCES.md Example of defining a ranged weapon with ammunition properties, damage, range, and descriptive text about ammunition usage. ```xml Longbow common R 2 50.0 A,H,2H,M 1d8 P 150/600 Ammo: arrow Ammunition: You can use a weapon that has the ammunition property to make a ranged attack only if you have ammunition to fire from the weapon. Each time you attack with the weapon, you expend one piece of ammunition. Drawing the ammunition from a quiver, case, or other container is part of the attack (you need a free hand to load a one-handed weapon). At the end of the battle, you can recover half your expended ammunition by taking a minute to search the battlefield. ``` -------------------------------- ### Compile Collection to Compendium Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/README.md Execute xsltproc to merge a collection file into a final compendium XML file. ```bash xsltproc --xinclude -o Compendiums/WotC_only.xml Utilities/merge.xslt Collections/WotC_5e_only.xml ``` -------------------------------- ### Generate Collection XML with Bash Script Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/Utilities/README.md Execute the generate-partial-collection.sh script to recursively find source XML files within a specified directory and create a partial collection.xml file. ```bash ./generate-partial-collection.sh Sources/DND_5e/Homebrew/ ``` -------------------------------- ### Create Collection File with XInclude Source: https://context7.com/vidalvanbergen/fightclub5exml/llms.txt XInclude allows modular inclusion of partial collection files for complex compendium builds. It enables combining multiple source categories efficiently. ```xml ``` -------------------------------- ### Validate XML Files with xmllint Source: https://context7.com/vidalvanbergen/fightclub5exml/llms.txt Use xmllint to validate compendium and collection files against their respective XSD schemas. ```bash # Validate a compendium source file xmllint --noout --schema Utilities/compendium.xsd Sources/DND_5e/WizardsOfTheCoast/01_Core/01_Players_Handbook/spells-phb.xml # Validate a collection file xmllint --noout --schema Utilities/collection.xsd Collections/Core_Rulebooks_5e.xml # Validate all source files in a directory for f in Sources/DND_5e/WizardsOfTheCoast/01_Core/01_Players_Handbook/*.xml; do xmllint --noout --schema Utilities/compendium.xsd "$f" && echo "✓ $f" done # Output on success: (no output, exit code 0) ``` -------------------------------- ### Windows Build Collections Script Usage Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/README.md This is the Windows batch file equivalent for compiling collections into compendiums. It supports similar options to the bash script. ```batch WIN-build-collections.bat [-5.5e] [-h/-?] [collection_names...] ``` -------------------------------- ### Define the base XML structure Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/SOURCES.md The standard template for a Fight Club 5e compendium XML file. ```xml ``` -------------------------------- ### Build Single Collection Manually Source: https://github.com/vidalvanbergen/fightclub5exml/blob/master/CONTRIBUTING.md Manually build a specific collection using xsltproc and the merge XSLT. This allows for targeted testing of collection updates. ```bash xsltproc --xinclude -o Compendiums/.xml Utilities/merge.xslt Collections/.xml ```