Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds AboutXml topic #301

Merged
merged 28 commits into from
Jan 13, 2020
Merged

Adds AboutXml topic #301

merged 28 commits into from
Jan 13, 2020

Conversation

indented-automation
Copy link
Contributor

@indented-automation indented-automation commented Oct 25, 2019

PR Summary

Fixes #255

Context

Adds koans which explore working with XML

Changes

Adds AboutKoans topic.

Checklist

  • Pull Request has a meaningful title.
  • Summarised changes.
  • Pull Request is ready to merge & is not WIP.
  • Added tests / only testable interactively.
    • Make sure you add a new test if old tests do not effectively test the code changed.
  • Added documentation / opened issue to track adding documentation at a later date.

@vexx32 vexx32 added Category-Koans Invoking the Great Doubt PR-Awaiting-Author ✏️ Waiting on a response from the user who submitted the PR. labels Oct 25, 2019
@vexx32 vexx32 changed the title Adds AboutKoans topic Adds AboutXml topic Oct 26, 2019
@vexx32 vexx32 added PR-Needs-Review 🔍 Let's take a closer look! and removed PR-Awaiting-Author ✏️ Waiting on a response from the user who submitted the PR. labels Jan 2, 2020
Copy link
Owner

@vexx32 vexx32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1st pass! Only got about halfway through, but hopefully some of this is helpful! 😁

PSKoans/Koans/Constructs and Patterns/AboutXml.Koans.ps1 Outdated Show resolved Hide resolved
PSKoans/Koans/Constructs and Patterns/AboutXml.Koans.ps1 Outdated Show resolved Hide resolved
PSKoans/Koans/Constructs and Patterns/AboutXml.Koans.ps1 Outdated Show resolved Hide resolved
PSKoans/Koans/Constructs and Patterns/AboutXml.Koans.ps1 Outdated Show resolved Hide resolved
PSKoans/Koans/Constructs and Patterns/AboutXml.Koans.ps1 Outdated Show resolved Hide resolved
PSKoans/Koans/Constructs and Patterns/AboutXml.Koans.ps1 Outdated Show resolved Hide resolved
PSKoans/Koans/Constructs and Patterns/AboutXml.Koans.ps1 Outdated Show resolved Hide resolved
PSKoans/Koans/Constructs and Patterns/AboutXml.Koans.ps1 Outdated Show resolved Hide resolved
PSKoans/Koans/Constructs and Patterns/AboutXml.Koans.ps1 Outdated Show resolved Hide resolved
indented-automation and others added 10 commits January 8, 2020 08:21
Co-Authored-By: Joel Sallow (/u/ta11ow) <32407840+vexx32@users.noreply.github.com>
Co-Authored-By: Joel Sallow (/u/ta11ow) <32407840+vexx32@users.noreply.github.com>
Co-Authored-By: Joel Sallow (/u/ta11ow) <32407840+vexx32@users.noreply.github.com>
Co-Authored-By: Joel Sallow (/u/ta11ow) <32407840+vexx32@users.noreply.github.com>
Co-Authored-By: Joel Sallow (/u/ta11ow) <32407840+vexx32@users.noreply.github.com>
Co-Authored-By: Joel Sallow (/u/ta11ow) <32407840+vexx32@users.noreply.github.com>
Co-Authored-By: Joel Sallow (/u/ta11ow) <32407840+vexx32@users.noreply.github.com>
Co-Authored-By: Joel Sallow (/u/ta11ow) <32407840+vexx32@users.noreply.github.com>
Co-Authored-By: Joel Sallow (/u/ta11ow) <32407840+vexx32@users.noreply.github.com>
Co-Authored-By: Joel Sallow (/u/ta11ow) <32407840+vexx32@users.noreply.github.com>
Copy link
Owner

@vexx32 vexx32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly minor stuff for the second half, by the looks of it.

Otherwise looks quite solid, nice work. Thanks! 😊

PSKoans/Koans/Constructs and Patterns/AboutXml.Koans.ps1 Outdated Show resolved Hide resolved
PSKoans/Koans/Constructs and Patterns/AboutXml.Koans.ps1 Outdated Show resolved Hide resolved
PSKoans/Koans/Constructs and Patterns/AboutXml.Koans.ps1 Outdated Show resolved Hide resolved
Comment on lines 616 to 617
The URI used for a namespace is often made-up, it does not have to exist on the Internet. The namespace
must be unique within the document.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird. Is there a history behind this I can read up on? Seems odd to use a URI if that won't really exist most of the time. 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can find similar statements around. It's not used by the parser (except as a unique value), so you can just make it up and XML parsers will accept it as valid.

For instance, take a MAML document. It has many, many, many namespaces. Picking the first from base.xsd, it looks perfectly valid:

https://schemas.microsoft.com/maml/2004/10

And it may even have worked at one time. It doesn't any more though. Nothing will care, all of the schema files are locally available at the end of the day.

Comment on lines +625 to +631
XML documents may declare more than one namespace. Additional namespaces are declared with a prefix.

<root xmlns="http://someuri/default.xsd" xmlns:prefix="http://someuri/prefix.xsd">
...
</root>

The prefix name is arbitrary but must be consistent within a document.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the common usage for additional namespaces in the one doc? Seems like an odd thing to have for XML. O.o

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code / schema reuse most often I suppose. Never had to design and XML schema so I don't really know to be honest :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to push a Group Policy document in there as an example. They're "wonderful" for massive use of namespaces. Decided against it though, difficult to make it actually useful.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be an interesting thing to pursue for a kata 😉

PSKoans/Koans/Constructs and Patterns/AboutXml.Koans.ps1 Outdated Show resolved Hide resolved
Co-Authored-By: Joel Sallow (/u/ta11ow) <32407840+vexx32@users.noreply.github.com>
Co-Authored-By: Joel Sallow (/u/ta11ow) <32407840+vexx32@users.noreply.github.com>
Copy link
Owner

@vexx32 vexx32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me on the whole.

@steviecoaster did you want to give this one a quick pass?

@vexx32 vexx32 removed the PR-Needs-Review 🔍 Let's take a closer look! label Jan 13, 2020
@vexx32 vexx32 merged commit a1f0830 into vexx32:master Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category-Koans Invoking the Great Doubt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Topic - AboutXml
2 participants